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

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
1.1.1.2 ! misho       8: --ENV--
        !             9: TEMP=.
        !            10: TMP=.
1.1       misho      11: --FILE--
                     12: <?php
                     13: $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar.zip', 0, 'brandnewphar.phar');
                     14: $p['file1.txt'] = 'hi';
                     15: $p->stopBuffering();
                     16: var_dump($p->getStub());
                     17: $p->setStub("<?php
                     18: function __autoload(\$class)
                     19: {
                     20:     include 'phar://' . str_replace('_', '/', \$class);
                     21: }
                     22: Phar::mapPhar('brandnewphar.phar');
                     23: include 'phar://brandnewphar.phar/startup.php';
                     24: __HALT_COMPILER();
                     25: ?>");
                     26: var_dump($p->getStub());
                     27: var_dump($p->isFileFormat(Phar::ZIP));
                     28: ?>
                     29: ===DONE===
                     30: --CLEAN--
                     31: <?php 
                     32: unlink(dirname(__FILE__) . '/brandnewphar.phar.zip');
                     33: ?>
                     34: --EXPECT--
                     35: string(60) "<?php // zip-based phar archive stub file
                     36: __HALT_COMPILER();"
                     37: string(200) "<?php
                     38: function __autoload($class)
                     39: {
                     40:     include 'phar://' . str_replace('_', '/', $class);
                     41: }
                     42: Phar::mapPhar('brandnewphar.phar');
                     43: include 'phar://brandnewphar.phar/startup.php';
                     44: __HALT_COMPILER(); ?>
                     45: "
                     46: bool(true)
1.1.1.2 ! misho      47: ===DONE===

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