summaryrefslogtreecommitdiff
path: root/ext/phar/tests/015.phpt
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2007-01-21 16:58:23 +0000
committerMarcus Boerger <helly@php.net>2007-01-21 16:58:23 +0000
commitfc80ed5913a85268418d17d5acb77fcac2f4a9ec (patch)
tree3c666e3a9ae9ebe7e8e78a61864dd9492e7833f2 /ext/phar/tests/015.phpt
parenta02afe32c10dea0cf4c48a2171730cba6cf971d0 (diff)
downloadphp-git-fc80ed5913a85268418d17d5acb77fcac2f4a9ec.tar.gz
- Update tests
Diffstat (limited to 'ext/phar/tests/015.phpt')
-rw-r--r--ext/phar/tests/015.phpt31
1 files changed, 9 insertions, 22 deletions
diff --git a/ext/phar/tests/015.phpt b/ext/phar/tests/015.phpt
index 4d5477c557..b7c4241433 100644
--- a/ext/phar/tests/015.phpt
+++ b/ext/phar/tests/015.phpt
@@ -1,36 +1,23 @@
--TEST--
Phar::mapPhar valid file (gzipped)
--SKIPIF--
-<?php if (!extension_loaded("phar")) print "skip";
-if (!extension_loaded("zlib")) print "skip zlib not present"; ?>
+<?php if (!extension_loaded("phar")) print "skip"; ?>
+<?php if (!extension_loaded("zlib")) print "skip zlib not present"; ?>
--INI--
phar.require_hash=0
--FILE--
<?php
-$file = "<?php
-Phar::mapPhar('hio');
-__HALT_COMPILER(); ?>";
+$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
+$pname = 'phar://' . $fname;
+$file = "<?php __HALT_COMPILER(); ?>";
$files = array();
-$files['a'] = 'a';
-$manifest = '';
-foreach($files as $name => $cont) {
- $len = strlen($cont);
- $manifest .= pack('V', strlen($name)) . $name . pack('VVVVVV', $len, time(), 3, crc32($cont), 0x00001000, 0);
-}
-$alias = 'hio';
-$manifest = pack('VnVV', count($files), 0x0900, 0x00001000, strlen($alias)) . $alias . $manifest;
-$file .= pack('V', strlen($manifest)) . $manifest;
-foreach($files as $cont)
-{
- $file .= chr(75) . chr(4) . chr(0); // 'a' gzdeflated
-}
+$files['a'] = array('cont'=>'a','comp'=>chr(75) . chr(4) . chr(0) /* 'a' gzdeflated */, 'flags'=>0x00001000);
+include 'phar_test.inc';
-file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
-include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
-echo file_get_contents('phar://hio/a');
+echo file_get_contents($pname .'/a');
?>
--CLEAN--
<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECT--
-a \ No newline at end of file
+a