Re: QA with PHPUnit test script and PHP_CodeSniffer ... with a bit of new of Services_W3C_CSSValidator
| From: | Chuck Burgess | Date: | Tue, 20 Nov 2007 13:57:11 +0000 |
| Subject: | Re: QA with PHPUnit test script and PHP_CodeSniffer ... with a bit of new of Services_W3C_CSSValidator | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-48498@lists.php.net to get a copy of this message | ||
On Nov 20, 2007 7:44 AM, Laurent Laville <pear@laurent-laville.org> wrote:
> This is related to constant used/implemented such as :
>
> if (!defined('PHPUnit_MAIN_METHOD')) {
> define('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)
>
/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.
+1
--
CRB
Let me introduce you to my very own DMCA-protected encryption key:
BC 1B 64 4A 8D DE 49 E8 C3 7D CC EE 1A AD EE F5
(compliments of Freedom-to-Tinker http://www.freedom-to-tinker.com/?p=1155)