Req #17798 [Csd]: PEAR CS: Add an exception for PHPUnit

From: Date: Wed, 25 Aug 2010 16:34:02 +0000
Subject: Req #17798 [Csd]: PEAR CS: Add an exception for PHPUnit
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-4676@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=17798&edit=1 ID: 17798 Updated by: sb@sebastian-bergmann.de Reported By: daniel dot oconnor at gmail dot com Summary: PEAR CS: Add an exception for PHPUnit Status: Closed Type: Feature/Change Request Package: PHP_CodeSniffer Package Version: SVN PHP Version: 5.3.3 Assigned To: squiz Roadmap Versions: New Comment: PHPUnit no longer relies on this constant (at least since PHPUnit 3.4). Previous Comments: ------------------------------------------------------------------------ [2010-08-23 05:53:52] squiz And forgot to mention that this is now working in SVN. ------------------------------------------------------------------------ [2010-08-23 05:53:29] squiz -Status: Open +Status: Closed -Assigned To: +Assigned To: squiz I don't see any reason not to include the exception. ------------------------------------------------------------------------ [2010-08-23 03:50:06] jeff_dickey Agreed this should be an exception. While the dogmatic approach would be to ask Sebastian to change his constant name, the sheer number of user tests that would almost certainly break were he to do so argue convincingly for a legacy-code exception to the rule. (Perhaps a duplicate, all-caps constant could be added, documented and encouraged, with the mixed-case one marked as legacy code that will break in a future non-BC release of PHPUnit?) ------------------------------------------------------------------------ [2010-08-22 23:41:39] doconnor Description: ------------ PHPUnit relies on a constant, named "PHPUnit_MAIN_METHOD". The PEAR CS asks for all constants to be uppercase. What happens is people do the right thing, and fix their code; only to have PHPUnit running their tests twice. if (PHPUNIT_MAIN_METHOD == 'PHP_Shell_AllTests::main') { PHP_Shell_AllTests::main(); } vs: if (PHPUnit_MAIN_METHOD == 'PHP_Shell_AllTests::main') { PHP_Shell_AllTests::main(); } Consider adding an exception for this to the relevant sniff. ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=17798&edit=1

« previous php.pear.bugs (#4676) next »