Re: com php-src: Added tests for bug 67436: Zend/tests/bug67436/a.php Zend/tests/bug67436/b.php Zend/tests/bug67436/bug67436.phpt
Zend/tests/bug67436/bug67436_nohandler.phpt Zend/tests/bug67436/c.php

From: Date: Thu, 19 Jun 2014 17:19:34 +0000
Subject: Re: com php-src: Added tests for bug 67436: Zend/tests/bug67436/a.php Zend/tests/bug67436/b.php Zend/tests/bug67436/bug67436.phpt
Zend/tests/bug67436/bug67436_nohandler.phpt Zend/tests/bug67436/c.php
References: 1 2 3  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-78992@lists.php.net to get a copy of this message
On Thu, Jun 19, 2014 at 7:15 PM, Levi Morrison <levim@php.net> wrote: > On Wed, Jun 18, 2014 at 4:28 PM, Ferenc Kovacs <tyra3l@gmail.com> wrote: > > > > > > > > On Mon, Jun 16, 2014 at 12:31 AM, Bob Weinand <bwoebi@php.net> wrote: > >> > >> Commit: 6c9c44905ea2b65c578e83c017565e3fed484078 > >> Author: Levi Morrison <levim@php.ent> Sun, 15 Jun 2014 > 16:10:40 > >> -0600 > >> Parents: 85d3ac5763c04def3ab64830d84f18da7d092ae5 > >> Branches: PHP-5.4 > >> > >> Link: > >> > > http://git.php.net/?p=php-src.git;a=commitdiff;h=6c9c44905ea2b65c578e83c017565e3fed484078 > >> > >> Log: > >> Added tests for bug 67436 > >> > >> Bugs: > >> https://bugs.php.net/67436 > >> > >> Changed paths: > >> A Zend/tests/bug67436/a.php > >> A Zend/tests/bug67436/b.php > >> A Zend/tests/bug67436/bug67436.phpt > >> A Zend/tests/bug67436/bug67436_nohandler.phpt > >> A Zend/tests/bug67436/c.php > >> > >> > >> Diff: > >> diff --git a/Zend/tests/bug67436/a.php b/Zend/tests/bug67436/a.php > >> new file mode 100644 > >> index 0000000..c560c2d > >> --- /dev/null > >> +++ b/Zend/tests/bug67436/a.php > >> @@ -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 > >> index 0000000..793a139 > >> --- /dev/null > >> +++ b/Zend/tests/bug67436/b.php > >> @@ -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 > >> index 0000000..49b8b49 > >> --- /dev/null > >> +++ b/Zend/tests/bug67436/bug67436.phpt > >> @@ -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 > >> index 0000000..464f711 > >> --- /dev/null > >> +++ b/Zend/tests/bug67436/bug67436_nohandler.phpt > >> @@ -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 > >> index 0000000..47c848b > >> --- /dev/null > >> +++ b/Zend/tests/bug67436/c.php > >> @@ -0,0 +1,5 @@ > >> +<?php > >> + > >> +class c { > >> + const TESTCONSTANT = "c::TESTCONSTANT"; > >> +} > >> > >> > >> -- > >> PHP CVS Mailing List (http://www.php.net/) > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > > > > you won't belive me, but I have to share the story: I had some leftover > > a.php b.php and c.php(from some previous bug reproduction) in the root > of my > > php-src clone, and make test were picking those up for these tests, so > for a > > moment it was a huge wtf why am I seeing completelly different output > than > > the expected. > > Should I prepend a __DIR__ statement before it just to eliminate this > kind of issue? > I think it would be nice, thanks! -- Ferenc Kovács @Tyr43l - http://tyrael.hu

« previous php.cvs (#78992) next »