diff options
Diffstat (limited to 'ext/standard/tests')
-rw-r--r-- | ext/standard/tests/dir/dir_variation1.phpt | 22 | ||||
-rw-r--r-- | ext/standard/tests/dir/opendir_variation1.phpt | 12 | ||||
-rw-r--r-- | ext/standard/tests/file/mkdir_rmdir_variation2.phpt | 2 | ||||
-rw-r--r-- | ext/standard/tests/file/tempnam_variation3-win32.phpt | 18 | ||||
-rw-r--r-- | ext/standard/tests/file/tempnam_variation3.phpt | 22 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/include_path.phpt | 4 | ||||
-rw-r--r-- | ext/standard/tests/strings/bug69522.phpt | 11 |
7 files changed, 52 insertions, 39 deletions
diff --git a/ext/standard/tests/dir/dir_variation1.phpt b/ext/standard/tests/dir/dir_variation1.phpt index abb4719504..fff04ba8f9 100644 --- a/ext/standard/tests/dir/dir_variation1.phpt +++ b/ext/standard/tests/dir/dir_variation1.phpt @@ -8,7 +8,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { ?> --FILE-- <?php -/* +/* * Prototype : object dir(string $directory[, resource $context]) * Description: Directory class with properties, handle and class and methods read, rewind and close * Source code: ext/standard/dir.c @@ -34,7 +34,7 @@ class A } // get a resource variable -$fp = fopen(__FILE__, "r"); // get a file handle +$fp = fopen(__FILE__, "r"); // get a file handle $dfp = opendir( dirname(__FILE__) ); // get a dir handle // unexpected values to be passed to $directory argument @@ -92,27 +92,27 @@ echo "Done"; -- Iteration 1 -- -Warning: dir() expects parameter 1 to be string, array given in %s on line %d +Warning: dir() expects parameter 1 to be a valid path, array given in %s on line %d NULL -- Iteration 2 -- -Warning: dir() expects parameter 1 to be string, array given in %s on line %d +Warning: dir() expects parameter 1 to be a valid path, array given in %s on line %d NULL -- Iteration 3 -- -Warning: dir() expects parameter 1 to be string, array given in %s on line %d +Warning: dir() expects parameter 1 to be a valid path, array given in %s on line %d NULL -- Iteration 4 -- -Warning: dir() expects parameter 1 to be string, array given in %s on line %d +Warning: dir() expects parameter 1 to be a valid path, array given in %s on line %d NULL -- Iteration 5 -- -Warning: dir() expects parameter 1 to be string, array given in %s on line %d +Warning: dir() expects parameter 1 to be a valid path, array given in %s on line %d NULL -- Iteration 6 -- @@ -151,16 +151,16 @@ bool(false) -- Iteration 16 -- -Warning: dir() expects parameter 1 to be string, resource given in %s on line %d +Warning: dir() expects parameter 1 to be a valid path, resource given in %s on line %d NULL -- Iteration 17 -- -Warning: dir() expects parameter 1 to be string, resource given in %s on line %d +Warning: dir() expects parameter 1 to be a valid path, resource given in %s on line %d NULL -- Iteration 18 -- -Warning: dir() expects parameter 1 to be string, object given in %s on line %d +Warning: dir() expects parameter 1 to be a valid path, object given in %s on line %d NULL -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/dir/opendir_variation1.phpt b/ext/standard/tests/dir/opendir_variation1.phpt index 8d195e1e62..cb4d543f72 100644 --- a/ext/standard/tests/dir/opendir_variation1.phpt +++ b/ext/standard/tests/dir/opendir_variation1.phpt @@ -9,7 +9,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { --FILE-- <?php /* Prototype : mixed opendir(string $path[, resource $context]) - * Description: Open a directory and return a dir_handle + * Description: Open a directory and return a dir_handle * Source code: ext/standard/dir.c */ @@ -30,7 +30,7 @@ unset ($unset_var); // get a class class classA { - + var $path; function __construct($path) { $this->path = $path; @@ -73,7 +73,7 @@ $inputs = array( false, TRUE, FALSE, - + // empty data /*16*/ "", '', @@ -83,7 +83,7 @@ $inputs = array( /*19*/ "$path", 'string', $heredoc, - + // object data /*22*/ new classA($path), @@ -194,7 +194,7 @@ bool(false) -- Iteration 18 -- -Warning: opendir() expects parameter 1 to be string, array given in %s on line %d +Warning: opendir() expects parameter 1 to be a valid path, array given in %s on line %d NULL -- Iteration 19 -- @@ -219,6 +219,6 @@ bool(false) -- Iteration 25 -- -Warning: opendir() expects parameter 1 to be string, resource given in %s on line %d +Warning: opendir() expects parameter 1 to be a valid path, resource given in %s on line %d NULL ===DONE=== diff --git a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt index 14dd361e07..24dfc96ac9 100644 --- a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt @@ -68,7 +68,7 @@ bool(false) Warning: mkdir() expects parameter 1 to be a valid path, string given in %s on line %d bool(false) -Warning: rmdir(%s): No such file or directory in %s on line %d +Warning: rmdir() expects parameter 1 to be a valid path, string given in %s on line %d bool(false) *** Testing mkdir() with miscelleneous input *** diff --git a/ext/standard/tests/file/tempnam_variation3-win32.phpt b/ext/standard/tests/file/tempnam_variation3-win32.phpt index fb457cb6ab..cc8194afa3 100644 --- a/ext/standard/tests/file/tempnam_variation3-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation3-win32.phpt @@ -22,9 +22,9 @@ if (!mkdir($file_path)) { $file_path = realpath($file_path); -/* An array of prefixes */ +/* An array of prefixes */ $names_arr = array( - /* Valid args (casting)*/ + /* Valid args (casting)*/ -1, TRUE, FALSE, @@ -32,17 +32,17 @@ $names_arr = array( "", " ", "\0", - /* Invalid args */ + /* Invalid args */ array(), - /* Valid args*/ + /* Valid args*/ /* prefix with path separator of a non existing directory*/ - "/no/such/file/dir", + "/no/such/file/dir", "php/php" ); $res_arr = array( - /* Invalid args */ + /* Invalid args */ true, true, true, @@ -53,7 +53,7 @@ $res_arr = array( false, /* prefix with path separator of a non existing directory*/ - true, + true, true ); @@ -72,7 +72,7 @@ for( $i=0; $i<count($names_arr); $i++ ) { } else { echo "Failed, not created in the correct directory " . realpath($file_dir) . ' vs ' . $file_path ."\n"; } - + if (!is_writable($file_name)) { printf("%o\n", fileperms($file_name) ); @@ -105,7 +105,7 @@ Failed, not created in the correct directory %s vs %s OK -- Iteration 7 -- -Warning: tempnam() expects parameter 2 to be string, array given in %s\ext\standard\tests\file\tempnam_variation3-win32.php on line %d +Warning: tempnam() expects parameter 2 to be a valid path, array given in %s\ext\standard\tests\file\tempnam_variation3-win32.php on line %d OK -- Iteration 8 -- OK diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt index 69ab16c896..11b87809fc 100644 --- a/ext/standard/tests/file/tempnam_variation3.phpt +++ b/ext/standard/tests/file/tempnam_variation3.phpt @@ -17,9 +17,9 @@ echo "*** Testing tempnam() with obscure prefixes ***\n"; $file_path = dirname(__FILE__)."/tempnamVar3"; mkdir($file_path); -/* An array of prefixes */ +/* An array of prefixes */ $names_arr = array( - /* Invalid args */ + /* Invalid args */ -1, TRUE, FALSE, @@ -30,7 +30,7 @@ $names_arr = array( array(), /* prefix with path separator of a non existing directory*/ - "/no/such/file/dir", + "/no/such/file/dir", "php/php" ); @@ -48,10 +48,10 @@ for( $i=0; $i<count($names_arr); $i++ ) { echo "File permissions are => "; printf("%o", fileperms($file_name) ); echo "\n"; - + echo "File created in => "; $file_dir = dirname($file_name); - + if ($file_dir == sys_get_temp_dir()) { echo "temp dir\n"; } @@ -61,7 +61,7 @@ for( $i=0; $i<count($names_arr); $i++ ) { else { echo "unknown location\n"; } - + } else { echo "-- File is not created --\n"; @@ -100,12 +100,14 @@ File name is => %s/%s File permissions are => 100600 File created in => directory specified -- Iteration 6 -- -File name is => %s/%s -File permissions are => 100600 -File created in => directory specified + +Warning: tempnam() expects parameter 2 to be a valid path, string given in %s on line %d +-- File is not created -- + +Warning: unlink(): %s in %s on line %d -- Iteration 7 -- -Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d +Warning: tempnam() expects parameter 2 to be a valid path, array given in %s on line %d -- File is not created -- Warning: unlink(): %s in %s on line %d diff --git a/ext/standard/tests/general_functions/include_path.phpt b/ext/standard/tests/general_functions/include_path.phpt index 039230784d..8b6626fbc8 100644 --- a/ext/standard/tests/general_functions/include_path.phpt +++ b/ext/standard/tests/general_functions/include_path.phpt @@ -41,7 +41,7 @@ var_dump(get_include_path()); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- string(1) "." Warning: get_include_path() expects exactly 0 parameters, 1 given in %s on line %d @@ -67,7 +67,7 @@ string(1) "." NULL string(1) "." -Warning: set_include_path() expects parameter 1 to be string, array given in %s on line %d +Warning: set_include_path() expects parameter 1 to be a valid path, array given in %s on line %d NULL string(1) "." NULL diff --git a/ext/standard/tests/strings/bug69522.phpt b/ext/standard/tests/strings/bug69522.phpt new file mode 100644 index 0000000000..fc86d409c6 --- /dev/null +++ b/ext/standard/tests/strings/bug69522.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #69522 (heap buffer overflow in unpack()) +--FILE-- +<?php +$a = pack("AAAAAAAAAAAA", 1,2,3,4,5,6,7,8,9,10,11,12); +$b = unpack('h2147483648', $a); +?> +===DONE=== +--EXPECTF-- +Warning: unpack(): Type h: integer overflow in %s on line %d +===DONE=== |