Annotation of embedaddon/php/ext/phar/tests/tar/phar_begin_setstub_commitU.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar::startBuffering()/setStub()/stopBuffering() tar-based
3: --SKIPIF--
4: <?php
5: if (!extension_loaded("phar")) die("skip");
6: if (version_compare(PHP_VERSION, "6.0", "<")) die("skip Unicode support required");
7: ?>
8: --INI--
9: phar.readonly=0
10: --FILE--
11: <?php
12: $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar.tar', 0, 'brandnewphar.phar');
13: var_dump($p->isFileFormat(Phar::TAR));
14: //var_dump($p->getStub());
15: var_dump($p->isBuffering());
16: $p->startBuffering();
17: var_dump($p->isBuffering());
18: $p['a.php'] = '<?php var_dump("Hello");';
19: $p->setStub('<?php var_dump("First"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>');
20: include 'phar://brandnewphar.phar/a.php';
21: var_dump($p->getStub());
22: $p['b.php'] = '<?php var_dump("World");';
23: $p->setStub('<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER();');
24: include 'phar://brandnewphar.phar/b.php';
25: var_dump($p->getStub());
26: $p->stopBuffering();
27: echo "===COMMIT===\n";
28: var_dump($p->isBuffering());
29: include 'phar://brandnewphar.phar/a.php';
30: include 'phar://brandnewphar.phar/b.php';
31: var_dump($p->getStub());
32: ?>
33: ===DONE===
34: --CLEAN--
35: <?php
36: unlink(dirname(__FILE__) . '/brandnewphar.phar.tar');
37: ?>
38: --EXPECT--
39: bool(true)
40: bool(false)
41: bool(true)
42: unicode(5) "Hello"
43: string(84) "<?php var_dump("First"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
44: "
45: unicode(5) "World"
46: string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
47: "
48: ===COMMIT===
49: bool(false)
50: unicode(5) "Hello"
51: unicode(5) "World"
52: string(85) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>
53: "
54: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>