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 13:44:02 +0000 |
| Subject: | QA with PHPUnit test script and PHP_CodeSniffer ... with a bit of new of Services_W3C_CSSValidator | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-48497@lists.php.net to get a copy of this message | ||
Another question about QA, and PHP_CodeSniffer (phpcs) output :
While I work again on my proposal Services_W3C_CSSValidator [1], and applied comments to solve conditional votes (one month ago; yes it's late, but I was busy), I've tried to :
run phpcs on tests directory
and found some errors that are not specific of my script, but all others
AllTests.php scripts
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();} That give phpcs output like : 17 | ERROR | Constants must be uppercase; expected 'PHPUNIT_MAIN_METHOD' but
| | found 'PHPUnit_MAIN_METHOD'71 | ERROR | Constants must be uppercase; expected PHPUNIT_MAIN_METHOD but
| | found PHPUnit_MAIN_METHODI 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) Laurent [1] http://pear.php.net/pepr/pepr-proposal-show.php?id=510