From: Steve Seear Date: Wed, 19 Mar 2008 17:25:47 +0000 (+0000) Subject: Adding filesystem tests X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~523 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9071a478b5738b3ccb8cf40359f3172af870c952;p=php Adding filesystem tests --- diff --git a/ext/standard/tests/file/fopen_variation1.phpt b/ext/standard/tests/file/fopen_variation1.phpt new file mode 100644 index 0000000000..53f635b6ed --- /dev/null +++ b/ext/standard/tests/file/fopen_variation1.phpt @@ -0,0 +1,14 @@ +--TEST-- +fopen() with relative path on a file in the script directory +--FILE-- + +--EXPECTF-- +resource(%d) of type (stream) diff --git a/ext/standard/tests/file/fread_socket_variation1.phpt b/ext/standard/tests/file/fread_socket_variation1.phpt new file mode 100644 index 0000000000..bd3d23ac57 --- /dev/null +++ b/ext/standard/tests/file/fread_socket_variation1.phpt @@ -0,0 +1,16 @@ +--TEST-- +Testing fread() on a TCP server socket +--FILE-- + +--EXPECT-- +string(0) "" diff --git a/ext/standard/tests/file/fseek_dir_basic.phpt b/ext/standard/tests/file/fseek_dir_basic.phpt new file mode 100644 index 0000000000..5204432b38 --- /dev/null +++ b/ext/standard/tests/file/fseek_dir_basic.phpt @@ -0,0 +1,66 @@ +--TEST-- +Testing fseek() on a directory stream +--FILE-- + +--EXPECTF-- +call readdir(): +resource(%d) of type (stream) +string(1) "." +string(2) ".." +string(9) "file1.tmp" +string(9) "file2.tmp" +string(9) "file3.tmp" + +call fseek() on directory resource: +int(0) +call readdir(): +string(1) "." +string(2) ".." +string(9) "file1.tmp" +string(9) "file2.tmp" +string(9) "file3.tmp" + +call fseek() with different arguments on directory resource: +int(0) +call readdir(): +string(1) "." +string(2) ".." +string(9) "file1.tmp" +string(9) "file2.tmp" +string(9) "file3.tmp" +bool(true) diff --git a/ext/standard/tests/file/glob_variation2.phpt b/ext/standard/tests/file/glob_variation2.phpt new file mode 100644 index 0000000000..f95fd17e7a --- /dev/null +++ b/ext/standard/tests/file/glob_variation2.phpt @@ -0,0 +1,57 @@ +--TEST-- +Test glob() function with relative path +--FILE-- + +--CLEAN-- + +--EXPECT-- +Testing glob() with relative paths: +array(1) { + [0]=> + string(11) "./file.text" +} +array(1) { + [0]=> + string(22) "../glob_test/file.text" +} +array(1) { + [0]=> + string(19) "glob_test/file.text" +} +array(1) { + [0]=> + string(9) "glob_test" +} +Done diff --git a/ext/standard/tests/file/parse_ini_file_error.phpt b/ext/standard/tests/file/parse_ini_file_error.phpt new file mode 100644 index 0000000000..db63f2cdb6 --- /dev/null +++ b/ext/standard/tests/file/parse_ini_file_error.phpt @@ -0,0 +1,53 @@ +--TEST-- +Test parse_ini_file() function : error conditions +--FILE-- + +--EXPECTF-- +*** Testing parse_ini_file() : error conditions *** + +-- Testing parse_ini_file() function with Zero arguments -- + +Warning: parse_ini_file() expects at least 1 parameter, 0 given in %s on line %d +bool(false) + +-- Testing parse_ini_file() function with more than expected no. of arguments -- + +Warning: parse_ini_file(%s): failed to open stream: No such file or directory in %s on line %d +array(0) { +} + +-- Testing parse_ini_file() function with a non-existent file -- + +Warning: parse_ini_file(%s): failed to open stream: No such file or directory in %s on line %d +array(0) { +} +Done diff --git a/ext/standard/tests/file/realpath_basic2.phpt b/ext/standard/tests/file/realpath_basic2.phpt new file mode 100644 index 0000000000..b71feb98b9 --- /dev/null +++ b/ext/standard/tests/file/realpath_basic2.phpt @@ -0,0 +1,13 @@ +--TEST-- +realpath() with relative directory +--FILE-- + +--EXPECT-- +bool(true) +bool(true) diff --git a/ext/standard/tests/file/realpath_basic3.phpt b/ext/standard/tests/file/realpath_basic3.phpt new file mode 100644 index 0000000000..ce9385591d --- /dev/null +++ b/ext/standard/tests/file/realpath_basic3.phpt @@ -0,0 +1,86 @@ +--TEST-- +Test realpath() with relative paths +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing basic functions of realpath() with files *** + +*** Testing realpath() on filenames *** + +-- Iteration 1 -- +string(%d) "%srealpath_basic%shome%srealpath_basic.tmp" + +-- Iteration 2 -- +string(%d) "%srealpath_basic%srealpath_basic.tmp" + +-- Iteration 3 -- +string(%d) "%srealpath_basic%shome%stest%srealpath_basic.tmp" + +-- Iteration 4 -- +string(%d) "%srealpath_basic%srealpath_basic.tmp" + +-- Iteration 5 -- +bool(false) + +-- Iteration 6 -- +bool(false) + +-- Iteration 7 -- +bool(false) +Done