PHPunit 3.5 and E_STRICT compatibility

From: Date: Thu, 13 Jan 2011 21:06:23 +0000
Subject: PHPunit 3.5 and E_STRICT compatibility
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-53978@lists.php.net to get a copy of this message
As I said to you two days ago, I've investigated on a strange behavior I found with one of my packages: Net_Growl that have been fixed to be E_STRICT compatible. The version 2.2.0, and its main classes fixed the compatibility but it was not the case of unit tests suites. I reproduced the issue with PHPUnit 3.5.6 and even with 3.5.7 On PHP5.2 I got ---------- PHPUnit 3.5.6 by Sebastian Bergmann. C:\php\pear\Net_Growl\trunk\tests Net_Growl_GntpMockTest .... Net_Growl_GntpTest ...........F. Time: 4 seconds, Memory: 4.25Mb There was 1 failure: 1) Net_Growl_GntpTest::testProtocolOptionCannotLoadClass Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -Cannot load class "Net_Growl_Foo" +Cannot find class "Net_Growl_Foo" C:\php\pear\Net_Growl\trunk\tests\Growl\GntpTest.php:635 FAILURES! Tests: 17, Assertions: 78, Failures: 1. ---------- That reminder me, I forgot to fix the unit tests when I fixed on version 2.2.1 the autoloader conflict. But if you run the same suite on PHP 5.3, you don't have the same result if E_STRICT error level is activate . You got this output ---------- PHPUnit 3.5.6 by Sebastian Bergmann. C:\php\pear\Net_Growl\trunk\tests Net_Growl_GntpMockTest Fatal error: Class 'PHPUnit_Framework_Error_Notice' not found in C:\UwAmp\apache\php_5.3.2\PEAR\Net\Growl\GntpMock.php on line 223 ---------- So here is my TIP to see if it's an E_STRICT related issue. De-activate level when you run a test suites. With PHP 5.3 (30719 === E_ALL) phpunit -d error_reporting=30719 --verbose C:\php\pear\Net_Growl\trunk\tests gave the same result as PHP 5.2 It was my TIP of the day Laurent Laville

« previous php.pear.dev (#53978) next »