diff options
author | Steph Fox <sfox@php.net> | 2008-08-01 13:36:19 +0000 |
---|---|---|
committer | Steph Fox <sfox@php.net> | 2008-08-01 13:36:19 +0000 |
commit | 755642c3550261d34f8633ba0a123dded36a47d1 (patch) | |
tree | 6be49c28f80e10e2a4d82252aeb06950906a8bc7 /ext/phar/tests/zip/phar_magic.phpt | |
parent | 2feac2e6d2e7f913e101b4dac315c0000cf1c06c (diff) | |
download | php-git-755642c3550261d34f8633ba0a123dded36a47d1.tar.gz |
- Bring phar tests into line across all branches
Diffstat (limited to 'ext/phar/tests/zip/phar_magic.phpt')
-rw-r--r-- | ext/phar/tests/zip/phar_magic.phpt | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/phar/tests/zip/phar_magic.phpt b/ext/phar/tests/zip/phar_magic.phpt index 4a17207376..a56639d7e0 100644 --- a/ext/phar/tests/zip/phar_magic.phpt +++ b/ext/phar/tests/zip/phar_magic.phpt @@ -1,23 +1,29 @@ --TEST-- Phar: include/fopen magic zip-based --SKIPIF-- -<?php if (!extension_loaded("phar")) die("skip"); ?> +<?php +if (!extension_loaded("phar")) die("skip"); +if (version_compare(PHP_VERSION, "6.0", ">")) die("skip pre-unicode version of PHP required"); +?> --INI-- phar.require_hash=0 phar.readonly=0 --FILE-- <?php $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip.php'; +$pname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip.php'; $p = new Phar($fname); var_dump($p->isFileFormat(Phar::ZIP)); $p['a'] = '<?php include "b/c.php";' . "\n"; $p['b/c.php'] = '<?php echo "in b\n";$a = fopen("a", "r", true);echo stream_get_contents($a);fclose($a);include dirname(__FILE__) . "/../d";'; $p['d'] = "in d\n"; $p->setStub('<?php +var_dump(__FILE__); +var_dump(substr(__FILE__, 0, 4) != "phar"); set_include_path("phar://" . __FILE__); include "phar://" . __FILE__ . "/a"; __HALT_COMPILER();'); -include $fname; +include $pname; ?> ===DONE=== --CLEAN-- @@ -27,6 +33,8 @@ __HALT_COMPILER(); ?> --EXPECTF-- bool(true) +string(%d) "%sphar_magic.phar.zip.php" +bool(true) in b <?php include "b/c.php"; in d |