summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/ReflectionMethod_invoke_error2.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/tests/ReflectionMethod_invoke_error2.phpt')
-rw-r--r--ext/reflection/tests/ReflectionMethod_invoke_error2.phpt34
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/reflection/tests/ReflectionMethod_invoke_error2.phpt b/ext/reflection/tests/ReflectionMethod_invoke_error2.phpt
new file mode 100644
index 000000000..cb3b1c2d2
--- /dev/null
+++ b/ext/reflection/tests/ReflectionMethod_invoke_error2.phpt
@@ -0,0 +1,34 @@
+--TEST--
+ReflectionMethod::invoke() further errors
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+
+class TestClass {
+
+ public function methodWithArgs($a, $b) {
+ echo "Called methodWithArgs($a, $b)\n";
+ }
+}
+
+$methodWithArgs = new ReflectionMethod('TestClass', 'methodWithArgs');
+
+$testClassInstance = new TestClass();
+
+echo "\nMethod with args:\n";
+var_dump($methodWithArgs->invoke($testClassInstance));
+
+?>
+--EXPECTF--
+Method with args:
+
+Warning: Missing argument 1 for TestClass::methodWithArgs() in %s on line %d
+
+Warning: Missing argument 2 for TestClass::methodWithArgs() in %s on line %d
+
+Notice: Undefined variable: a in %s on line %d
+
+Notice: Undefined variable: b in %s on line %d
+Called methodWithArgs(, )
+NULL