Annotation of embedaddon/php/ext/phar/tests/zip/phar_commitwrite.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Phar::setStub()/stopBuffering() zip-based
        !             3: --SKIPIF--
        !             4: <?php if (!extension_loaded("phar")) die("skip"); ?>
        !             5: --INI--
        !             6: phar.require_hash=0
        !             7: phar.readonly=0
        !             8: --FILE--
        !             9: <?php
        !            10: $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar.zip', 0, 'brandnewphar.phar');
        !            11: $p['file1.txt'] = 'hi';
        !            12: $p->stopBuffering();
        !            13: var_dump($p->getStub());
        !            14: $p->setStub("<?php
        !            15: function __autoload(\$class)
        !            16: {
        !            17:     include 'phar://' . str_replace('_', '/', \$class);
        !            18: }
        !            19: Phar::mapPhar('brandnewphar.phar');
        !            20: include 'phar://brandnewphar.phar/startup.php';
        !            21: __HALT_COMPILER();
        !            22: ?>");
        !            23: var_dump($p->getStub());
        !            24: var_dump($p->isFileFormat(Phar::ZIP));
        !            25: ?>
        !            26: ===DONE===
        !            27: --CLEAN--
        !            28: <?php 
        !            29: unlink(dirname(__FILE__) . '/brandnewphar.phar.zip');
        !            30: ?>
        !            31: --EXPECT--
        !            32: string(60) "<?php // zip-based phar archive stub file
        !            33: __HALT_COMPILER();"
        !            34: string(200) "<?php
        !            35: function __autoload($class)
        !            36: {
        !            37:     include 'phar://' . str_replace('_', '/', $class);
        !            38: }
        !            39: Phar::mapPhar('brandnewphar.phar');
        !            40: include 'phar://brandnewphar.phar/startup.php';
        !            41: __HALT_COMPILER(); ?>
        !            42: "
        !            43: bool(true)
        !            44: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>