Re: QA with PHPUnit test script and PHP_CodeSniffer ... with a bit of new of Services_W3C_CSSValidator
| From: | Laurent Laville | Date: | Tue, 20 Nov 2007 14:06:33 +0000 |
| Subject: | Re: QA with PHPUnit test script and PHP_CodeSniffer ... with a bit of new of Services_W3C_CSSValidator | ||
| References: | 1 2 | Groups: | php.pear.dev php.pear.dev |
| Request: | Send a blank email to pear-dev+get-48500@lists.php.net to get a copy of this message | ||
Chuck Burgess a écrit :
On Nov 20, 2007 7:44 AM, Laurent Laville <pear@laurent-laville.org> wrote:Due to implementation of Christian script [1] and its impact on all others, don't forget this main piece of puzzle. [1] http://cvs.php.net/viewvc.cgi/pear/AllTests.phpThis is related to constant used/implemented such as : if (!defined('PHPUnit_MAIN_METHOD')) {/me blushes with some embarassment... I had long ago completely dismissed the possibility of acting on that Codesniffer error because I had immediately assumed that the *PHPUnit_MAIN_METHOD *constant was actually defined in the PhpUnit codebase itself. Looking at it now in the way you present those lines from the test case file, it looks more likely that the constant is entirely local to the test file itself, and therefore we're free to do anything we want to do with that constant's name. +1define('PHPUnit_MAIN_METHOD','Services_W3C_CSSValidator_AllTests::main'); } ... if (PHPUnit_MAIN_METHOD == 'Services_W3C_CSSValidator_AllTests::main') {Services_W3C_CSSValidator_AllTests::main();} I think we should use as recommanded by phpcs, and set the constant in uppercase. Of course all tests script (from other package) should be fixed. Are you agree with this ?! (please vote +1/-1/0)