From: Felipe Pena Date: Sun, 20 Dec 2009 22:04:55 +0000 (+0000) Subject: - New tests X-Git-Tag: php-5.4.0alpha1~191^2~2194 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5e1c1718b9054cf34835b9abb7b9a2b2dc647d4;p=php - New tests --- diff --git a/Zend/tests/call_user_func_004.phpt b/Zend/tests/call_user_func_004.phpt new file mode 100644 index 0000000000..4885c4d3fa --- /dev/null +++ b/Zend/tests/call_user_func_004.phpt @@ -0,0 +1,18 @@ +--TEST-- +Calling non-static method with call_user_func() +--FILE-- +a = 1; + } +} + +call_user_func(array('foo', 'teste')); + +?> +--EXPECTF-- +Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method foo::teste() should not be called statically in %s on line %d + +Fatal error: Using $this when not in object context in %s on line %d diff --git a/Zend/tests/call_user_func_005.phpt b/Zend/tests/call_user_func_005.phpt new file mode 100644 index 0000000000..6c1fa19733 --- /dev/null +++ b/Zend/tests/call_user_func_005.phpt @@ -0,0 +1,35 @@ +--TEST-- +Passing Closure as parameter to an non-existent function +--FILE-- + +--EXPECTF-- +Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method foo::teste() should not be called statically in %s on line %d +%string|unicode%(1) "x" +array(1) { + [0]=> + object(Closure)#%d (1) { + ["parameter"]=> + array(2) { + ["$a"]=> + string(10) "" + ["$b"]=> + string(10) "" + } + } +} +int(1) diff --git a/Zend/tests/closure_035.phpt b/Zend/tests/closure_035.phpt new file mode 100644 index 0000000000..ac8b4caea0 --- /dev/null +++ b/Zend/tests/closure_035.phpt @@ -0,0 +1,31 @@ +--TEST-- +Testing recursion detection with Closures +--FILE-- + +--EXPECTF-- +object(Closure)#%d (1) { + ["static"]=> + array(1) { + [%u|b%"x"]=> + &object(Closure)#%d (1) { + ["static"]=> + array(1) { + [%u|b%"x"]=> + *RECURSION* + } + } + } +} +int(1)