From: andy wharmby Date: Sun, 14 Jun 2009 13:49:18 +0000 (+0000) Subject: Basic tests for function_exists() and get_defined_functions(). Tested on Windows... X-Git-Tag: php-5.4.0alpha1~191^2~3329 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fada257def560fdea281a16ce4e2569fd3444f9f;p=php Basic tests for function_exists() and get_defined_functions(). Tested on Windows, Linux and Linux 64 bit. --- diff --git a/Zend/tests/function_exists_basic.phpt b/Zend/tests/function_exists_basic.phpt new file mode 100644 index 0000000000..469e3d8c9a --- /dev/null +++ b/Zend/tests/function_exists_basic.phpt @@ -0,0 +1,39 @@ +--TEST-- +function_exists function : basic functionality +--FILE-- + +===Done=== +--EXPECT-- +*** Testing function_exists() : basic functionality *** +Internal function: bool(true) +User defined function: bool(true) +Case sensitivity: bool(true) +Non existent function: bool(false) +Method: bool(false) +===Done=== diff --git a/Zend/tests/function_exists_error.phpt b/Zend/tests/function_exists_error.phpt new file mode 100644 index 0000000000..c95dc0718f --- /dev/null +++ b/Zend/tests/function_exists_error.phpt @@ -0,0 +1,37 @@ +--TEST-- +Test function_exists() function : error conditions +--INI-- +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing function_exists() : error conditions *** + +Too many arguments + +Warning: function_exists() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Too few arguments + +Warning: function_exists() expects exactly 1 parameter, 0 given in %s on line %d +NULL +===Done=== + diff --git a/Zend/tests/function_exists_variation1.phpt b/Zend/tests/function_exists_variation1.phpt new file mode 100644 index 0000000000..b7da99fe1b --- /dev/null +++ b/Zend/tests/function_exists_variation1.phpt @@ -0,0 +1,138 @@ +--TEST-- +Test function_exists() function : usage variations - test values for $str argument +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing function_exists() function: with unexpected inputs for 'str' argument *** +-- Iteration 1 -- +bool(false) +-- Iteration 2 -- +bool(false) +-- Iteration 3 -- +bool(false) +-- Iteration 4 -- +bool(false) +-- Iteration 5 -- +bool(false) +-- Iteration 6 -- +bool(false) +-- Iteration 7 -- +bool(false) +-- Iteration 8 -- +bool(false) +-- Iteration 9 -- +bool(false) +-- Iteration 10 -- + +Warning: function_exists() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: function_exists() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 12 -- + +Warning: function_exists() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 13 -- +bool(false) +-- Iteration 14 -- +bool(false) +-- Iteration 15 -- +bool(false) +-- Iteration 16 -- +bool(false) +-- Iteration 17 -- +bool(false) +-- Iteration 18 -- +bool(false) +-- Iteration 19 -- +bool(false) +-- Iteration 20 -- + +Warning: function_exists() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d +NULL +-- Iteration 21 -- +bool(false) +-- Iteration 22 -- +bool(false) +===Done=== + \ No newline at end of file diff --git a/Zend/tests/get_defined_functions_basic.phpt b/Zend/tests/get_defined_functions_basic.phpt new file mode 100644 index 0000000000..a849e32c78 --- /dev/null +++ b/Zend/tests/get_defined_functions_basic.phpt @@ -0,0 +1,59 @@ +--TEST-- +get_defined_functions() function : basic functionality +--FILE-- + +===Done=== +--EXPECT-- +*** Testing get_defined_functions() : basic functionality *** +TEST PASSED +===Done=== diff --git a/Zend/tests/get_defined_functions_error.phpt b/Zend/tests/get_defined_functions_error.phpt new file mode 100644 index 0000000000..fcb01e031e --- /dev/null +++ b/Zend/tests/get_defined_functions_error.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test get_defined_functions() function : error conditions +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing get_defined_functions() : error conditions *** + +-- Testing get_defined_functions() function with more than expected no. of arguments -- + +Warning: get_defined_functions() expects exactly 0 parameters, 1 given in %s on line %d +NULL + +===Done===