summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
authorTimm Friebe <thekid@thekid.de>2014-04-19 14:01:16 +0200
committerTimm Friebe <thekid@thekid.de>2014-04-19 14:01:16 +0200
commitbdb0cee222fe851d2dc6566962ff253c81e9e8f0 (patch)
treeab9df09e0c9f20b4042d015e2d56eb48a52c131c /Zend/tests
parent0cdc57b3cf6b63466cf6c612ce7ef4598236926d (diff)
downloadphp-git-bdb0cee222fe851d2dc6566962ff253c81e9e8f0.tar.gz
Initial implementation
Diffstat (limited to 'Zend/tests')
-rw-r--r--Zend/tests/methods-on-non-objects-args-catch.phpt18
-rw-r--r--Zend/tests/methods-on-non-objects-catch.phpt18
-rw-r--r--Zend/tests/methods-on-non-objects.phpt12
3 files changed, 48 insertions, 0 deletions
diff --git a/Zend/tests/methods-on-non-objects-args-catch.phpt b/Zend/tests/methods-on-non-objects-args-catch.phpt
new file mode 100644
index 0000000000..2dd54cb65d
--- /dev/null
+++ b/Zend/tests/methods-on-non-objects-args-catch.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Catch method calls on non-objects raise recoverable errors
+--FILE--
+<?php
+set_error_handler(function($code, $message) {
+ var_dump($code, $message);
+});
+
+$x= null;
+var_dump($x->method(1, 2, 3));
+echo "Alive\n";
+?>
+--EXPECTF--
+
+int(4096)
+string(%d) "Call to a member function method() on a non-object"
+NULL
+Alive
diff --git a/Zend/tests/methods-on-non-objects-catch.phpt b/Zend/tests/methods-on-non-objects-catch.phpt
new file mode 100644
index 0000000000..30a9c774cc
--- /dev/null
+++ b/Zend/tests/methods-on-non-objects-catch.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Catch method calls on non-objects raise recoverable errors
+--FILE--
+<?php
+set_error_handler(function($code, $message) {
+ var_dump($code, $message);
+});
+
+$x= null;
+var_dump($x->method());
+echo "Alive\n";
+?>
+--EXPECTF--
+
+int(4096)
+string(%d) "Call to a member function method() on a non-object"
+NULL
+Alive
diff --git a/Zend/tests/methods-on-non-objects.phpt b/Zend/tests/methods-on-non-objects.phpt
new file mode 100644
index 0000000000..cc426374c8
--- /dev/null
+++ b/Zend/tests/methods-on-non-objects.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Method calls on non-objects raise recoverable errors
+--FILE--
+<?php
+
+$x= null;
+$x->method();
+echo "Should not get here!\n";
+?>
+--EXPECTF--
+
+Catchable fatal error: Call to a member function method() on a non-object in %s on line %d