From: andy wharmby Date: Sun, 14 Jun 2009 13:49:19 +0000 (+0000) Subject: Basic tests for function_exists() and get_defined_functions(). Tested on Windows... X-Git-Tag: php-5.2.10~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4ba76cdecdb6e9e75c8f4955f28f2ad3b1607bd;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..a4c1294149 --- /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: Wrong parameter count for function_exists() in %s on line %d +NULL + +Too few arguments + +Warning: Wrong parameter count for function_exists() 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..70cf6bed55 --- /dev/null +++ b/Zend/tests/function_exists_variation1.phpt @@ -0,0 +1,135 @@ +--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 -- + +Notice: Array to string conversion in %s on line %d +bool(false) +-- Iteration 11 -- + +Notice: Array to string conversion in %s on line %d +bool(false) +-- Iteration 12 -- + +Notice: Array to string conversion in %s on line %d +bool(false) +-- 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 -- +bool(false) +-- Iteration 21 -- +bool(false) +-- Iteration 22 -- +bool(false) +===Done=== 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..0626ed00de --- /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: Wrong parameter count for get_defined_functions() in %s on line %d +NULL + +===Done===