From: andy wharmby Date: Sun, 1 Feb 2009 18:55:24 +0000 (+0000) Subject: New get_defined_vars(), get_included_files(), get_magic_quotes() and getmypid() tests... X-Git-Tag: php-5.4.0alpha1~191^2~4353 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a400e979ade6fdf647bafbbb146dfb67dbad635;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..586e660087 --- /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) { + [u"vars"]=> + array(0) { + } + [u"i"]=> + int(123) + [u"f"]=> + float(123.456) + [u"b"]=> + bool(false) + [u"s"]=> + unicode(11) "Hello World" + [u"arr"]=> + array(4) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + } +} + + -- Function f2() called -- + +-- ...define some variables -- +array(6) { + [u"vars"]=> + array(0) { + } + [u"i"]=> + int(456) + [u"f"]=> + float(456.678) + [u"b"]=> + bool(true) + [u"s"]=> + unicode(9) "Goodnight" + [u"arr"]=> + array(2) { + [0]=> + unicode(3) "foo" + [1]=> + unicode(3) "bar" + } +} + +-- ...define some more variables -- +array(9) { + [u"vars"]=> + array(0) { + } + [u"i"]=> + int(456) + [u"f"]=> + float(456.678) + [u"b"]=> + bool(true) + [u"s"]=> + unicode(9) "Goodnight" + [u"arr"]=> + array(2) { + [0]=> + unicode(3) "foo" + [1]=> + unicode(3) "bar" + } + [u"i1"]=> + int(456) + [u"f1"]=> + float(456.678) + [u"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..d29ed0facb --- /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() +unicode(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..8b82e9461b --- /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]=> + unicode(%d) "%sget_included_files.php" +} + +-- List included files atfter including inc1 - +array(2) { + [0]=> + unicode(%d) "%sget_included_files.php" + [1]=> + unicode(%d) "%sget_included_files_inc1.inc" +} + +-- List included files atfter including inc2 which will include inc3 which includes inc1 -- +array(4) { + [0]=> + unicode(%d) "%sget_included_files.php" + [1]=> + unicode(%d) "%sget_included_files_inc1.inc" + [2]=> + unicode(%d) "%sget_included_files_inc2.inc" + [3]=> + unicode(%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..d06cd9571a --- /dev/null +++ b/ext/standard/tests/general_functions/get_magic_quotes_gpc.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test get_magic_quotes_gpc() function +--FILE-- + +===DONE=== +--EXPECT-- +Simple testcase for get_magic_quotes_gpc() function +bool(false) + +-- Error cases -- +bool(false) +===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..033e2c04fe --- /dev/null +++ b/ext/standard/tests/general_functions/get_magic_quotes_runtime.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test get_magic_quotes_runtime() function +--FILE-- + +===DONE=== +--EXPECTF-- +Simple testcase for get_magic_quotes_runtime() function +bool(false) + +-- Error cases -- +bool(false) +===DONE=== \ No newline at end of file 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