From: Steve Seear Date: Wed, 19 Mar 2008 17:26:36 +0000 (+0000) Subject: Adding filesystem tests X-Git-Tag: RELEASE_2_0_0a1~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4f5622904b2b9119a70ae0ef36749918401260d;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..14b9836bdc --- /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-- +bool(false) 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..4d29e0748c --- /dev/null +++ b/ext/standard/tests/file/fseek_dir_basic.phpt @@ -0,0 +1,93 @@ +--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) +--UEXPECTF-- +call readdir(): +resource(%d) of type (stream) +unicode(1) "." +unicode(2) ".." +unicode(9) "file1.tmp" +unicode(9) "file2.tmp" +unicode(9) "file3.tmp" + +call fseek() on directory resource: +int(0) +call readdir(): +unicode(1) "." +unicode(2) ".." +unicode(9) "file1.tmp" +unicode(9) "file2.tmp" +unicode(9) "file3.tmp" + +call fseek() with different arguments on directory resource: +int(0) +call readdir(): +unicode(1) "." +unicode(2) ".." +unicode(9) "file1.tmp" +unicode(9) "file2.tmp" +unicode(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..51383bb2bb --- /dev/null +++ b/ext/standard/tests/file/glob_variation2.phpt @@ -0,0 +1,76 @@ +--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 +--UEXPECT-- +Testing glob() with relative paths: +array(1) { + [0]=> + unicode(11) "./file.text" +} +array(1) { + [0]=> + unicode(22) "../glob_test/file.text" +} +array(1) { + [0]=> + unicode(19) "glob_test/file.text" +} +array(1) { + [0]=> + unicode(9) "glob_test" +} +Done \ No newline at end of file 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..e1bf8308fc --- /dev/null +++ b/ext/standard/tests/file/realpath_basic3.phpt @@ -0,0 +1,112 @@ +--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 +--UEXPECTF-- +*** Testing basic functions of realpath() with files *** + +*** Testing realpath() on filenames *** + +-- Iteration 1 -- +unicode(%d) "%srealpath_basic%shome%srealpath_basic.tmp" + +-- Iteration 2 -- +unicode(%d) "%srealpath_basic%srealpath_basic.tmp" + +-- Iteration 3 -- +unicode(%d) "%srealpath_basic%shome%stest%srealpath_basic.tmp" + +-- Iteration 4 -- +unicode(%d) "%srealpath_basic%srealpath_basic.tmp" + +-- Iteration 5 -- +bool(false) + +-- Iteration 6 -- +bool(false) + +-- Iteration 7 -- +bool(false) +Done \ No newline at end of file