diff options
Diffstat (limited to 'ext/phar/tests/phar_create_in_cwd.phpt')
-rw-r--r-- | ext/phar/tests/phar_create_in_cwd.phpt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/ext/phar/tests/phar_create_in_cwd.phpt b/ext/phar/tests/phar_create_in_cwd.phpt new file mode 100644 index 0000000000..8545880565 --- /dev/null +++ b/ext/phar/tests/phar_create_in_cwd.phpt @@ -0,0 +1,41 @@ +--TEST-- +Phar: create a Phar with relative path +--SKIPIF-- +<?php if (!extension_loaded("phar")) print "skip"; ?> +--INI-- +phar.require_hash=0 +phar.readonly=0 +--FILE-- +<?php +$p = new Phar('brandnewphar.phar'); +$p['file1.txt'] = 'hi'; +$p->commit(); +var_dump($p->getStub()); +$p->commit("<?php +function __autoload(\$class) +{ + include 'phar://' . str_replace('_', '/', \$class); +} +Phar::mapPhar('brandnewphar.phar'); +include 'phar://brandnewphar.phar/startup.php'; +__HALT_COMPILER(); +?>"); +var_dump($p->getStub()); +?> +===DONE=== +--CLEAN-- +<?php +unlink(dirname(__FILE__) . '/brandnewphar.phar'); +?> +--EXPECT-- +string(24) "<?php __HALT_COMPILER();" +string(198) "<?php +function __autoload($class) +{ + include 'phar://' . str_replace('_', '/', $class); +} +Phar::mapPhar('brandnewphar.phar'); +include 'phar://brandnewphar.phar/startup.php'; +__HALT_COMPILER(); +?>" +===DONE===
\ No newline at end of file |