From: andy wharmby Date: Sun, 1 Feb 2009 18:55:26 +0000 (+0000) Subject: New get_defined_vars(), get_included_files(), get_magic_quotes() and getmypid() tests... X-Git-Tag: RELEASE_1_3_5~195 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c07a980ed7af19919e8ecc3b94751f714c9e219;p=php New get_defined_vars(), get_included_files(), get_magic_quotes() and getmypid() tests. Tested on Winows, Linux and Linux 64 --- diff --git a/ext/standard/tests/general_functions/get_defined_vars_basic.phpt b/ext/standard/tests/general_functions/get_defined_vars_basic.phpt new file mode 100644 index 0000000000..3aa6e72a92 --- /dev/null +++ b/ext/standard/tests/general_functions/get_defined_vars_basic.phpt @@ -0,0 +1,152 @@ +--TEST-- +Test get_defined_vars() function +--FILE-- + +===DONE=== +--EXPECT-- +Simple testcase for get_defined_vars() function + + +-- Get variables at global scope -- + +-- Function f1() called -- + +-- ..define some local variables -- +array(6) { + ["vars"]=> + array(0) { + } + ["i"]=> + int(123) + ["f"]=> + float(123.456) + ["b"]=> + bool(false) + ["s"]=> + string(11) "Hello World" + ["arr"]=> + array(4) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + } +} + + -- Function f2() called -- + +-- ...define some variables -- +array(6) { + ["vars"]=> + array(0) { + } + ["i"]=> + int(456) + ["f"]=> + float(456.678) + ["b"]=> + bool(true) + ["s"]=> + string(9) "Goodnight" + ["arr"]=> + array(2) { + [0]=> + string(3) "foo" + [1]=> + string(3) "bar" + } +} + +-- ...define some more variables -- +array(9) { + ["vars"]=> + array(0) { + } + ["i"]=> + int(456) + ["f"]=> + float(456.678) + ["b"]=> + bool(true) + ["s"]=> + string(9) "Goodnight" + ["arr"]=> + array(2) { + [0]=> + string(3) "foo" + [1]=> + string(3) "bar" + } + ["i1"]=> + int(456) + ["f1"]=> + float(456.678) + ["b1"]=> + bool(true) +} +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/general_functions/get_include_path_basic.phpt b/ext/standard/tests/general_functions/get_include_path_basic.phpt new file mode 100644 index 0000000000..999862bc64 --- /dev/null +++ b/ext/standard/tests/general_functions/get_include_path_basic.phpt @@ -0,0 +1,37 @@ +--TEST-- +Test get_include_path() function +--INI-- +include_path=. +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing get_include_path() +string(1) "." +PASSED + +Error cases: + +Warning: get_include_path() expects exactly 0 parameters, 1 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/general_functions/get_included_files.phpt b/ext/standard/tests/general_functions/get_included_files.phpt new file mode 100644 index 0000000000..e7e1ed5219 --- /dev/null +++ b/ext/standard/tests/general_functions/get_included_files.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test get_include_files() function +--INI-- +include_path=. +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing get_included_files() + +-- List included files at start -- +array(1) { + [0]=> + string(%d) "%sget_included_files.php" +} + +-- List included files atfter including inc1 - +array(2) { + [0]=> + string(%d) "%sget_included_files.php" + [1]=> + string(%d) "%sget_included_files_inc1.inc" +} + +-- List included files atfter including inc2 which will include inc3 which includes inc1 -- +array(4) { + [0]=> + string(%d) "%sget_included_files.php" + [1]=> + string(%d) "%sget_included_files_inc1.inc" + [2]=> + string(%d) "%sget_included_files_inc2.inc" + [3]=> + string(%d) "%sget_included_files_inc3.inc" +} + +-- Error cases -- + +Warning: get_included_files() expects exactly 0 parameters, 1 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/general_functions/get_included_files_inc1.inc b/ext/standard/tests/general_functions/get_included_files_inc1.inc new file mode 100644 index 0000000000..344e300e08 --- /dev/null +++ b/ext/standard/tests/general_functions/get_included_files_inc1.inc @@ -0,0 +1,3 @@ + diff --git a/ext/standard/tests/general_functions/get_included_files_inc2.inc b/ext/standard/tests/general_functions/get_included_files_inc2.inc new file mode 100644 index 0000000000..318eba00c5 --- /dev/null +++ b/ext/standard/tests/general_functions/get_included_files_inc2.inc @@ -0,0 +1,4 @@ + diff --git a/ext/standard/tests/general_functions/get_included_files_inc3.inc b/ext/standard/tests/general_functions/get_included_files_inc3.inc new file mode 100644 index 0000000000..f666edf2b9 --- /dev/null +++ b/ext/standard/tests/general_functions/get_included_files_inc3.inc @@ -0,0 +1,4 @@ + diff --git a/ext/standard/tests/general_functions/get_magic_quotes_gpc.phpt b/ext/standard/tests/general_functions/get_magic_quotes_gpc.phpt new file mode 100644 index 0000000000..cfa4dcc681 --- /dev/null +++ b/ext/standard/tests/general_functions/get_magic_quotes_gpc.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test get_magic_quotes_gpc() function +--INI-- +magic_quotes_gpc = 0 +--FILE-- + +===DONE=== +--EXPECT-- +Simple testcase for get_magic_quotes_gpc() function + +-- magic quotes gpc set in INI file: 0 -- + +-- Set magic quotes gpc to 1 - not allowed so should fail! -- +bool(false) + +-- magic quotes gpc after set: 0 -- + +-- Set magic quotes gpc to 0: -- +bool(false) + +-- magic quotes gpc after set: 0 -- + +-- Error cases -- +int(0) +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/general_functions/get_magic_quotes_runtime.phpt b/ext/standard/tests/general_functions/get_magic_quotes_runtime.phpt new file mode 100644 index 0000000000..761accce34 --- /dev/null +++ b/ext/standard/tests/general_functions/get_magic_quotes_runtime.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test get_magic_quotes_runtime() function +--INI- +magic_quotes_runtime = 0 +--FILE-- + +===DONE=== +--EXPECTF-- +Simple testcase for get_magic_quotes_runtime() function + +-- magic quotes runtime set in INI file: 0 -- + +-- Set magic quotes runtime to 1: -- + +Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d +bool(true) + +-- magic quotes runtime after set: 1 -- + +-- Set magic quotes runtime to 0: -- + +Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d +bool(true) + +-- magic quotes runtime after set: 0 -- + +-- Set magic quotes runtime to 1: -- + +Deprecated: Function set_magic_quotes_runtime() is deprecated in %s on line %d +bool(true) + +-- magic quotes runtime after set: 1 -- + +-- Error cases -- +int(1) +===DONE=== diff --git a/ext/standard/tests/general_functions/getmypid_basic.phpt b/ext/standard/tests/general_functions/getmypid_basic.phpt new file mode 100644 index 0000000000..869eb59442 --- /dev/null +++ b/ext/standard/tests/general_functions/getmypid_basic.phpt @@ -0,0 +1,20 @@ +--TEST-- +Test getmypid() function: basic test +--FILE-- + +--EXPECTF-- +Simple testcase for getmypid() function +int(%d) +Done \ No newline at end of file