]> granicus.if.org Git - php/commitdiff
Added tests for bug 67436
authorLevi Morrison <levim@php.ent>
Sun, 15 Jun 2014 22:10:40 +0000 (16:10 -0600)
committerLevi Morrison <levim@php.ent>
Sun, 15 Jun 2014 22:31:39 +0000 (16:31 -0600)
Zend/tests/bug67436/a.php [new file with mode: 0644]
Zend/tests/bug67436/b.php [new file with mode: 0644]
Zend/tests/bug67436/bug67436.phpt [new file with mode: 0644]
Zend/tests/bug67436/bug67436_nohandler.phpt [new file with mode: 0644]
Zend/tests/bug67436/c.php [new file with mode: 0644]

diff --git a/Zend/tests/bug67436/a.php b/Zend/tests/bug67436/a.php
new file mode 100644 (file)
index 0000000..c560c2d
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+class a {
+       public function test($arg = c::TESTCONSTANT) {
+               echo __METHOD__ . "($arg)\n";
+       }
+
+       static public function staticTest() {
+       }
+}
diff --git a/Zend/tests/bug67436/b.php b/Zend/tests/bug67436/b.php
new file mode 100644 (file)
index 0000000..793a139
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+
+class b extends a {
+       public function test() {
+               echo __METHOD__ . "()\n";
+               parent::test();
+       }
+}
diff --git a/Zend/tests/bug67436/bug67436.phpt b/Zend/tests/bug67436/bug67436.phpt
new file mode 100644 (file)
index 0000000..49b8b49
--- /dev/null
@@ -0,0 +1,26 @@
+--TEST--
+bug67436: Autoloader isn't called if user defined error handler is present
+
+--INI--
+error_reporting=
+
+--FILE--
+<?php
+
+spl_autoload_register(function($classname) {
+       if (in_array($classname, array('a','b','c'))) {
+               require_once ($classname . '.php');
+       }
+});
+
+set_error_handler(function ($errno, $errstr, $errfile, $errline) {
+}, error_reporting());
+
+a::staticTest();
+
+$b = new b();
+$b->test();
+
+--EXPECT--
+b::test()
+a::test(c::TESTCONSTANT)
diff --git a/Zend/tests/bug67436/bug67436_nohandler.phpt b/Zend/tests/bug67436/bug67436_nohandler.phpt
new file mode 100644 (file)
index 0000000..464f711
--- /dev/null
@@ -0,0 +1,24 @@
+--TEST--
+bug67436: E_STRICT instead of custom error handler
+
+--INI--
+error_reporting=-1
+
+--FILE--
+<?php
+
+spl_autoload_register(function($classname) {
+       if (in_array($classname, array('a','b','c'))) {
+               require_once ($classname . '.php');
+       }
+});
+
+a::staticTest();
+
+$b = new b();
+$b->test();
+
+--EXPECTF--
+Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s/bug67436/b.php on line %d
+b::test()
+a::test(c::TESTCONSTANT)
diff --git a/Zend/tests/bug67436/c.php b/Zend/tests/bug67436/c.php
new file mode 100644 (file)
index 0000000..47c848b
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+class c {
+       const TESTCONSTANT = "c::TESTCONSTANT";
+}