summaryrefslogtreecommitdiff
path: root/ext/phar/tests/017.phpt
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2005-12-11 07:25:30 +0000
committerGreg Beaver <cellog@php.net>2005-12-11 07:25:30 +0000
commit7187bdc0d378e96a36446be07350b277e7157611 (patch)
treeeff3ba22e318862604537de5c8966622598e440d /ext/phar/tests/017.phpt
parenta1bef775100849aff8aee68de6a97d05e1b8a179 (diff)
downloadphp-git-7187bdc0d378e96a36446be07350b277e7157611.tar.gz
add opendir/readdir test for root dir, fix dir stat
Diffstat (limited to 'ext/phar/tests/017.phpt')
-rw-r--r--ext/phar/tests/017.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/phar/tests/017.phpt b/ext/phar/tests/017.phpt
new file mode 100644
index 0000000000..52b477c762
--- /dev/null
+++ b/ext/phar/tests/017.phpt
@@ -0,0 +1,20 @@
+--TEST--
+opendir test - no dir specified at all
+--SKIPIF--
+<?php if (!extension_loaded("phar")) print "skip"; ?>
+--FILE--
+<?php
+function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
+register_shutdown_function('cleanup');
+$file = "<?php
+PHP_Archive::mapPhar(5, 'hio', true);
+__HALT_COMPILER(); ?>";
+// file length is too short
+$manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9);
+$file .= pack('VV', strlen($manifest) + 4, 1) . $manifest . pack('VV', crc32('a'), 1) . 'a';
+file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
+include dirname(__FILE__) . '/008_phar.php';
+$dir = opendir('phar://hio');
+?>
+--EXPECTF--
+Warning: opendir(phar://hio): failed to open dir: phar error: no directory in "phar://hio", must have at least phar://hio/ for root directory in %s on line %d \ No newline at end of file