From a0f0f6c36ade4cac57bcfae929bd1738ab2b8dbd Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Sun, 1 Jan 2006 21:43:14 +0000 Subject: [PATCH] update tests to new API (16, 18, 19 still fail) --- ext/phar/tests/001.phpt | 2 +- ext/phar/tests/002.phpt | 9 ++------- ext/phar/tests/012.phpt | 2 +- ext/phar/tests/013.phpt | 2 +- ext/phar/tests/014.phpt | 2 +- ext/phar/tests/015.phpt | 2 +- ext/phar/tests/016.phpt | 2 +- ext/phar/tests/017.phpt | 2 +- ext/phar/tests/018.phpt | 2 +- ext/phar/tests/019.phpt | 2 +- ext/phar/tests/020.phpt | 18 +++++++++--------- ext/phar/tests/021.phpt | 10 +++++----- ext/phar/tests/022.phpt | 2 +- 13 files changed, 26 insertions(+), 31 deletions(-) diff --git a/ext/phar/tests/001.phpt b/ext/phar/tests/001.phpt index b424093885..8a18e3ffdb 100644 --- a/ext/phar/tests/001.phpt +++ b/ext/phar/tests/001.phpt @@ -7,4 +7,4 @@ PHP_Archive::apiVersion echo PHP_Archive::apiVersion(); ?> --EXPECT-- -0.7 \ No newline at end of file +0.7.1 \ No newline at end of file diff --git a/ext/phar/tests/002.phpt b/ext/phar/tests/002.phpt index 703dcff23c..0b79d19f49 100644 --- a/ext/phar/tests/002.phpt +++ b/ext/phar/tests/002.phpt @@ -9,15 +9,10 @@ PHP_Archive::mapPhar(5); PHP_Archive::mapPhar(5, 5); PHP_Archive::mapPhar(5, 'hio'); PHP_Archive::mapPhar(5, 'hio', 'hi'); -PHP_Archive::mapPhar(5, 'hio', true, 5, 5); __HALT_COMPILER(); ?> --EXPECTF-- -Warning: PHP_Archive::mapPhar() expects at least 3 parameters, 0 given in %s on line %d +Warning: PHP_Archive::mapPhar() expects at least 2 parameters, 0 given in %s on line %d -Warning: PHP_Archive::mapPhar() expects at least 3 parameters, 1 given in %s on line %d - -Warning: PHP_Archive::mapPhar() expects at least 3 parameters, 2 given in %s on line %d - -Warning: PHP_Archive::mapPhar() expects at least 3 parameters, 2 given in %s on line %d +Warning: PHP_Archive::mapPhar() expects at least 2 parameters, 1 given in %s on line %d Fatal error: PHP_Archive::mapPhar(): internal corruption of phar "%s" (truncated manifest) in %s on line %d \ No newline at end of file diff --git a/ext/phar/tests/012.phpt b/ext/phar/tests/012.phpt index 71f624f680..e605415c80 100644 --- a/ext/phar/tests/012.phpt +++ b/ext/phar/tests/012.phpt @@ -7,7 +7,7 @@ PHP_Archive::mapPhar valid file function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); } register_shutdown_function('cleanup'); $file = ""; $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'; diff --git a/ext/phar/tests/013.phpt b/ext/phar/tests/013.phpt index 9c97cd08a4..d6b442c868 100644 --- a/ext/phar/tests/013.phpt +++ b/ext/phar/tests/013.phpt @@ -7,7 +7,7 @@ PHP_Archive::mapPhar filesize mismatch function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); } register_shutdown_function('cleanup'); $file = ""; // filesize should be 1, and is 2 $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9); diff --git a/ext/phar/tests/014.phpt b/ext/phar/tests/014.phpt index 0959a66df7..3cfb377038 100644 --- a/ext/phar/tests/014.phpt +++ b/ext/phar/tests/014.phpt @@ -7,7 +7,7 @@ PHP_Archive::mapPhar filesize mismatch function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); } register_shutdown_function('cleanup'); $file = ""; // wrong crc32 $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9); diff --git a/ext/phar/tests/015.phpt b/ext/phar/tests/015.phpt index 47d9d50ba4..81aad086bf 100644 --- a/ext/phar/tests/015.phpt +++ b/ext/phar/tests/015.phpt @@ -8,7 +8,7 @@ if (!PHP_Archive::canCompress()) print "skip"; ?> function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); } register_shutdown_function('cleanup'); $file = ""; $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 11); $file .= pack('VV', strlen($manifest) + 4, 1) . $manifest . pack('VV', crc32('a'), 1) . chr(75) . chr(4) . chr(0); // 'a' gzdeflated diff --git a/ext/phar/tests/016.phpt b/ext/phar/tests/016.phpt index b92ef501c6..7a51bbe23f 100644 --- a/ext/phar/tests/016.phpt +++ b/ext/phar/tests/016.phpt @@ -8,7 +8,7 @@ if (!PHP_Archive::canCompress()) print "skip"; ?> function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); } register_shutdown_function('cleanup'); $file = ""; // file length is too short $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9); diff --git a/ext/phar/tests/017.phpt b/ext/phar/tests/017.phpt index 52b477c762..8d0387bcdc 100644 --- a/ext/phar/tests/017.phpt +++ b/ext/phar/tests/017.phpt @@ -7,7 +7,7 @@ opendir test - no dir specified at all function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); } register_shutdown_function('cleanup'); $file = ""; // file length is too short $manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9); diff --git a/ext/phar/tests/018.phpt b/ext/phar/tests/018.phpt index be5eb8bf92..3f860bfeb4 100644 --- a/ext/phar/tests/018.phpt +++ b/ext/phar/tests/018.phpt @@ -7,7 +7,7 @@ opendir test, root directory function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); } register_shutdown_function('cleanup'); $file = ""; $manifest = ''; $manifest .= pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9); diff --git a/ext/phar/tests/019.phpt b/ext/phar/tests/019.phpt index ce2f599ae8..970de7bfcb 100644 --- a/ext/phar/tests/019.phpt +++ b/ext/phar/tests/019.phpt @@ -7,7 +7,7 @@ opendir test, subdirectory function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); } register_shutdown_function('cleanup'); $file = ""; $manifest = ''; $manifest .= pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9); diff --git a/ext/phar/tests/020.phpt b/ext/phar/tests/020.phpt index 53bf17a4f1..31ceababce 100644 --- a/ext/phar/tests/020.phpt +++ b/ext/phar/tests/020.phpt @@ -7,7 +7,7 @@ url stat function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); } register_shutdown_function('cleanup'); $file = ""; $manifest = ''; $manifest .= pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9); @@ -27,9 +27,9 @@ var_dump(stat('phar://hio/a'), stat('phar://hio/b')); --EXPECTF-- array(26) { [0]=> - int(0) + int(12) [1]=> - int(0) + int(2090329158) [2]=> int(33060) [3]=> @@ -53,9 +53,9 @@ array(26) { [12]=> int(-1) ["dev"]=> - int(0) + int(12) ["ino"]=> - int(0) + int(2090329158) ["mode"]=> int(33060) ["nlink"]=> @@ -81,9 +81,9 @@ array(26) { } array(26) { [0]=> - int(0) + int(12) [1]=> - int(0) + int(2090329108) [2]=> int(16676) [3]=> @@ -107,9 +107,9 @@ array(26) { [12]=> int(-1) ["dev"]=> - int(0) + int(12) ["ino"]=> - int(0) + int(2090329108) ["mode"]=> int(16676) ["nlink"]=> diff --git a/ext/phar/tests/021.phpt b/ext/phar/tests/021.phpt index a571b1ee28..21f02034a4 100644 --- a/ext/phar/tests/021.phpt +++ b/ext/phar/tests/021.phpt @@ -7,7 +7,7 @@ stream stat function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); } register_shutdown_function('cleanup'); $file = ""; $manifest = ''; $manifest .= pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9); @@ -29,9 +29,9 @@ fclose($fp); --EXPECTF-- array(26) { [0]=> - int(0) + int(12) [1]=> - int(0) + int(2090329158) [2]=> int(33060) [3]=> @@ -55,9 +55,9 @@ array(26) { [12]=> int(-1) ["dev"]=> - int(0) + int(12) ["ino"]=> - int(0) + int(2090329158) ["mode"]=> int(33060) ["nlink"]=> diff --git a/ext/phar/tests/022.phpt b/ext/phar/tests/022.phpt index 95a6fd8d2d..f95c67eb2b 100644 --- a/ext/phar/tests/022.phpt +++ b/ext/phar/tests/022.phpt @@ -7,7 +7,7 @@ stream stat function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); } register_shutdown_function('cleanup'); $file = ""; $contents = 'abcdefg'; $manifest = pack('V', 1) . 'a' . pack('VVVV', strlen($contents), time(), 0, 8 + strlen($contents)); -- 2.50.1