From 6aa6434abfe4f2cf2cd73e85d1a16c1860b52b04 Mon Sep 17 00:00:00 2001 From: Raghubansh Kumar Date: Sun, 12 Aug 2007 05:16:19 +0000 Subject: [PATCH] More new testcases for fopen() & fclose() functions --- ext/standard/tests/file/007_variation1.phpt | 54 +++++++++++++ ext/standard/tests/file/007_variation10.phpt | 58 ++++++++++++++ .../tests/file/007_variation11-win32.phpt | 76 ++++++++++++++++++ ext/standard/tests/file/007_variation11.phpt | 76 ++++++++++++++++++ .../tests/file/007_variation12-win32.phpt | 78 +++++++++++++++++++ ext/standard/tests/file/007_variation12.phpt | 78 +++++++++++++++++++ .../tests/file/007_variation13-win32.phpt | 65 ++++++++++++++++ ext/standard/tests/file/007_variation13.phpt | 65 ++++++++++++++++ ext/standard/tests/file/007_variation14.phpt | 62 +++++++++++++++ ext/standard/tests/file/007_variation15.phpt | 58 ++++++++++++++ ext/standard/tests/file/007_variation16.phpt | 60 ++++++++++++++ ext/standard/tests/file/007_variation17.phpt | 54 +++++++++++++ ext/standard/tests/file/007_variation18.phpt | 58 ++++++++++++++ ext/standard/tests/file/007_variation19.phpt | 71 +++++++++++++++++ ext/standard/tests/file/007_variation2.phpt | 58 ++++++++++++++ ext/standard/tests/file/007_variation20.phpt | 73 +++++++++++++++++ ext/standard/tests/file/007_variation21.phpt | 60 ++++++++++++++ ext/standard/tests/file/007_variation22.phpt | 62 +++++++++++++++ ext/standard/tests/file/007_variation23.phpt | 58 ++++++++++++++ ext/standard/tests/file/007_variation24.phpt | 60 ++++++++++++++ ext/standard/tests/file/007_variation3.phpt | 71 +++++++++++++++++ ext/standard/tests/file/007_variation4.phpt | 73 +++++++++++++++++ ext/standard/tests/file/007_variation5.phpt | 60 ++++++++++++++ ext/standard/tests/file/007_variation6.phpt | 62 +++++++++++++++ ext/standard/tests/file/007_variation7.phpt | 58 ++++++++++++++ ext/standard/tests/file/007_variation8.phpt | 60 ++++++++++++++ ext/standard/tests/file/007_variation9.phpt | 54 +++++++++++++ 27 files changed, 1722 insertions(+) create mode 100644 ext/standard/tests/file/007_variation1.phpt create mode 100644 ext/standard/tests/file/007_variation10.phpt create mode 100644 ext/standard/tests/file/007_variation11-win32.phpt create mode 100644 ext/standard/tests/file/007_variation11.phpt create mode 100644 ext/standard/tests/file/007_variation12-win32.phpt create mode 100644 ext/standard/tests/file/007_variation12.phpt create mode 100644 ext/standard/tests/file/007_variation13-win32.phpt create mode 100644 ext/standard/tests/file/007_variation13.phpt create mode 100644 ext/standard/tests/file/007_variation14.phpt create mode 100644 ext/standard/tests/file/007_variation15.phpt create mode 100644 ext/standard/tests/file/007_variation16.phpt create mode 100644 ext/standard/tests/file/007_variation17.phpt create mode 100644 ext/standard/tests/file/007_variation18.phpt create mode 100644 ext/standard/tests/file/007_variation19.phpt create mode 100644 ext/standard/tests/file/007_variation2.phpt create mode 100644 ext/standard/tests/file/007_variation20.phpt create mode 100644 ext/standard/tests/file/007_variation21.phpt create mode 100644 ext/standard/tests/file/007_variation22.phpt create mode 100644 ext/standard/tests/file/007_variation23.phpt create mode 100644 ext/standard/tests/file/007_variation24.phpt create mode 100644 ext/standard/tests/file/007_variation3.phpt create mode 100644 ext/standard/tests/file/007_variation4.phpt create mode 100644 ext/standard/tests/file/007_variation5.phpt create mode 100644 ext/standard/tests/file/007_variation6.phpt create mode 100644 ext/standard/tests/file/007_variation7.phpt create mode 100644 ext/standard/tests/file/007_variation8.phpt create mode 100644 ext/standard/tests/file/007_variation9.phpt diff --git a/ext/standard/tests/file/007_variation1.phpt b/ext/standard/tests/file/007_variation1.phpt new file mode 100644 index 0000000000..c3a2ccc17a --- /dev/null +++ b/ext/standard/tests/file/007_variation1.phpt @@ -0,0 +1,54 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "r" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'r' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +string(20) "line +line of text +li" +int(0) +bool(true) +string(7) "Unknown" +*** Done *** diff --git a/ext/standard/tests/file/007_variation10.phpt b/ext/standard/tests/file/007_variation10.phpt new file mode 100644 index 0000000000..ce6d293a9e --- /dev/null +++ b/ext/standard/tests/file/007_variation10.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "r+t" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'r+t' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +string(20) "line +line of text +li" +int(20) +int(37) +int(57) +bool(true) +string(7) "Unknown" +*** Done *** diff --git a/ext/standard/tests/file/007_variation11-win32.phpt b/ext/standard/tests/file/007_variation11-win32.phpt new file mode 100644 index 0000000000..94017e7e54 --- /dev/null +++ b/ext/standard/tests/file/007_variation11-win32.phpt @@ -0,0 +1,76 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "wt" mode +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'wt' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(0) "" +int(0) +bool(true) +string(7) "Unknown" +int(39) +int(0) +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation11.phpt b/ext/standard/tests/file/007_variation11.phpt new file mode 100644 index 0000000000..aa75dfad77 --- /dev/null +++ b/ext/standard/tests/file/007_variation11.phpt @@ -0,0 +1,76 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "wt" mode +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'wt' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(0) "" +int(0) +bool(true) +string(7) "Unknown" +int(37) +int(0) +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation12-win32.phpt b/ext/standard/tests/file/007_variation12-win32.phpt new file mode 100644 index 0000000000..e439f441b8 --- /dev/null +++ b/ext/standard/tests/file/007_variation12-win32.phpt @@ -0,0 +1,78 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "w+t" mode +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'w+t' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(37) "abcdefghij +mnopqrst uvwxyz +0123456789" +int(37) +bool(true) +string(7) "Unknown" +int(39) +int(0) +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation12.phpt b/ext/standard/tests/file/007_variation12.phpt new file mode 100644 index 0000000000..bb6634fd0b --- /dev/null +++ b/ext/standard/tests/file/007_variation12.phpt @@ -0,0 +1,78 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "w+t" mode +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'w+t' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(37) "abcdefghij +mnopqrst uvwxyz +0123456789" +int(37) +bool(true) +string(7) "Unknown" +int(37) +int(0) +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation13-win32.phpt b/ext/standard/tests/file/007_variation13-win32.phpt new file mode 100644 index 0000000000..fa6c6db394 --- /dev/null +++ b/ext/standard/tests/file/007_variation13-win32.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "at" mode +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'at' mode *** +resource(8) of type (stream) +string(6) "stream" +int(37) +string(0) "" +int(0) +bool(true) +string(7) "Unknown" +int(59) +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation13.phpt b/ext/standard/tests/file/007_variation13.phpt new file mode 100644 index 0000000000..a0489ee770 --- /dev/null +++ b/ext/standard/tests/file/007_variation13.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "at" mode +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'at' mode *** +resource(8) of type (stream) +string(6) "stream" +int(37) +string(0) "" +int(0) +bool(true) +string(7) "Unknown" +int(57) +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation14.phpt b/ext/standard/tests/file/007_variation14.phpt new file mode 100644 index 0000000000..21f515c968 --- /dev/null +++ b/ext/standard/tests/file/007_variation14.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "a+t" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'a+t' mode *** +resource(8) of type (stream) +string(6) "stream" +int(37) +string(57) "line +line of text +liabcdefghij +mnopqrst uvwxyz +0123456789" +int(57) +bool(true) +string(7) "Unknown" +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation15.phpt b/ext/standard/tests/file/007_variation15.phpt new file mode 100644 index 0000000000..018df41599 --- /dev/null +++ b/ext/standard/tests/file/007_variation15.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "xt" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'xt' mode *** +resource(5) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(0) "" +int(0) +bool(true) +string(7) "Unknown" + +Warning: fopen(%s): failed to open stream: File exists in %s on line %s +*** Done *** diff --git a/ext/standard/tests/file/007_variation16.phpt b/ext/standard/tests/file/007_variation16.phpt new file mode 100644 index 0000000000..8857338ccb --- /dev/null +++ b/ext/standard/tests/file/007_variation16.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "x+t" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'x+t' mode *** +resource(5) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(37) "abcdefghij +mnopqrst uvwxyz +0123456789" +int(37) +bool(true) +string(7) "Unknown" + +Warning: fopen(%s): failed to open stream: File exists in %s on line %d +*** Done *** diff --git a/ext/standard/tests/file/007_variation17.phpt b/ext/standard/tests/file/007_variation17.phpt new file mode 100644 index 0000000000..fd8dcc326a --- /dev/null +++ b/ext/standard/tests/file/007_variation17.phpt @@ -0,0 +1,54 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "rb" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'rb' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +string(20) "line +line of text +li" +int(0) +bool(true) +string(7) "Unknown" +*** Done *** diff --git a/ext/standard/tests/file/007_variation18.phpt b/ext/standard/tests/file/007_variation18.phpt new file mode 100644 index 0000000000..2b43b5c3c9 --- /dev/null +++ b/ext/standard/tests/file/007_variation18.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "r+b" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'r+b' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +string(20) "line +line of text +li" +int(20) +int(37) +int(57) +bool(true) +string(7) "Unknown" +*** Done *** diff --git a/ext/standard/tests/file/007_variation19.phpt b/ext/standard/tests/file/007_variation19.phpt new file mode 100644 index 0000000000..74f9ebe34b --- /dev/null +++ b/ext/standard/tests/file/007_variation19.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "wb" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'wb' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(0) "" +int(0) +bool(true) +string(7) "Unknown" +int(37) +int(0) +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation2.phpt b/ext/standard/tests/file/007_variation2.phpt new file mode 100644 index 0000000000..774e4af87a --- /dev/null +++ b/ext/standard/tests/file/007_variation2.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "r+" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'r+' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +string(20) "line +line of text +li" +int(20) +int(37) +int(57) +bool(true) +string(7) "Unknown" +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/007_variation20.phpt b/ext/standard/tests/file/007_variation20.phpt new file mode 100644 index 0000000000..5a67beda2e --- /dev/null +++ b/ext/standard/tests/file/007_variation20.phpt @@ -0,0 +1,73 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "w+b" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'w+b' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(37) "abcdefghij +mnopqrst uvwxyz +0123456789" +int(37) +bool(true) +string(7) "Unknown" +int(37) +int(0) +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation21.phpt b/ext/standard/tests/file/007_variation21.phpt new file mode 100644 index 0000000000..ccef2db300 --- /dev/null +++ b/ext/standard/tests/file/007_variation21.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "ab" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'ab' mode *** +resource(8) of type (stream) +string(6) "stream" +int(37) +string(0) "" +int(0) +bool(true) +string(7) "Unknown" +int(57) +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation22.phpt b/ext/standard/tests/file/007_variation22.phpt new file mode 100644 index 0000000000..61c80e2229 --- /dev/null +++ b/ext/standard/tests/file/007_variation22.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "a+b" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'a+b' mode *** +resource(8) of type (stream) +string(6) "stream" +int(37) +string(57) "line +line of text +liabcdefghij +mnopqrst uvwxyz +0123456789" +int(57) +bool(true) +string(7) "Unknown" +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation23.phpt b/ext/standard/tests/file/007_variation23.phpt new file mode 100644 index 0000000000..5f21164c5f --- /dev/null +++ b/ext/standard/tests/file/007_variation23.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "xb" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'xb' mode *** +resource(5) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(0) "" +int(0) +bool(true) +string(7) "Unknown" + +Warning: fopen(%s): failed to open stream: File exists in %s on line %s +*** Done *** diff --git a/ext/standard/tests/file/007_variation24.phpt b/ext/standard/tests/file/007_variation24.phpt new file mode 100644 index 0000000000..26130b55b1 --- /dev/null +++ b/ext/standard/tests/file/007_variation24.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "x+b" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'x+b' mode *** +resource(5) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(37) "abcdefghij +mnopqrst uvwxyz +0123456789" +int(37) +bool(true) +string(7) "Unknown" + +Warning: fopen(%s): failed to open stream: File exists in %s on line %d +*** Done *** diff --git a/ext/standard/tests/file/007_variation3.phpt b/ext/standard/tests/file/007_variation3.phpt new file mode 100644 index 0000000000..728f6e2c8a --- /dev/null +++ b/ext/standard/tests/file/007_variation3.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "w" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'w' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(0) "" +int(0) +bool(true) +string(7) "Unknown" +int(37) +int(0) +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation4.phpt b/ext/standard/tests/file/007_variation4.phpt new file mode 100644 index 0000000000..b86e534ab1 --- /dev/null +++ b/ext/standard/tests/file/007_variation4.phpt @@ -0,0 +1,73 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "w+" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'w+' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(37) "abcdefghij +mnopqrst uvwxyz +0123456789" +int(37) +bool(true) +string(7) "Unknown" +int(37) +int(0) +bool(true) +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/007_variation5.phpt b/ext/standard/tests/file/007_variation5.phpt new file mode 100644 index 0000000000..5cb9f44401 --- /dev/null +++ b/ext/standard/tests/file/007_variation5.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "a" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'a' mode *** +resource(8) of type (stream) +string(6) "stream" +int(37) +string(0) "" +int(0) +bool(true) +string(7) "Unknown" +int(57) +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation6.phpt b/ext/standard/tests/file/007_variation6.phpt new file mode 100644 index 0000000000..4cd6494c18 --- /dev/null +++ b/ext/standard/tests/file/007_variation6.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "a+" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'a+' mode *** +resource(8) of type (stream) +string(6) "stream" +int(37) +string(57) "line +line of text +liabcdefghij +mnopqrst uvwxyz +0123456789" +int(57) +bool(true) +string(7) "Unknown" +bool(true) +*** Done *** diff --git a/ext/standard/tests/file/007_variation7.phpt b/ext/standard/tests/file/007_variation7.phpt new file mode 100644 index 0000000000..ffb97e38a6 --- /dev/null +++ b/ext/standard/tests/file/007_variation7.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "x" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'x' mode *** +resource(5) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(0) "" +int(0) +bool(true) +string(7) "Unknown" + +Warning: fopen(%s): failed to open stream: File exists in %s on line %s +*** Done *** diff --git a/ext/standard/tests/file/007_variation8.phpt b/ext/standard/tests/file/007_variation8.phpt new file mode 100644 index 0000000000..bad41136db --- /dev/null +++ b/ext/standard/tests/file/007_variation8.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "x+" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'x+' mode *** +resource(5) of type (stream) +string(6) "stream" +int(0) +int(37) +int(37) +string(37) "abcdefghij +mnopqrst uvwxyz +0123456789" +int(37) +bool(true) +string(7) "Unknown" + +Warning: fopen(%s): failed to open stream: File exists in %s on line %d +*** Done *** diff --git a/ext/standard/tests/file/007_variation9.phpt b/ext/standard/tests/file/007_variation9.phpt new file mode 100644 index 0000000000..b9cc004f88 --- /dev/null +++ b/ext/standard/tests/file/007_variation9.phpt @@ -0,0 +1,54 @@ +--TEST-- +Test fopen and fclose() functions - usage variations - "rt" mode +--FILE-- + +--EXPECTF-- +*** Test fopen() & fclose() functions: with 'rt' mode *** +resource(8) of type (stream) +string(6) "stream" +int(0) +string(20) "line +line of text +li" +int(0) +bool(true) +string(7) "Unknown" +*** Done *** -- 2.40.0