FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17878&edit=1

ID: 17878
Updated by: gsherwood@squiz.net
Reported By: public at arachnidae dot com
Summary: config file not loaded properly during unit testing
Status: Open
-Type: Bug
+Type: Feature/Change Request
Package: PHP_CodeSniffer
Operating System: osx 10.6
Package Version: 1.3.0RC1
PHP Version: 5.3.2
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:

-Type: Bug
+Type: Feature/Change Request
-Assigned To:
+Assigned To: squiz
The unit testing system has absolutely no support for setting command
line values, especially those that affect the parsing of files.

I'll leave this as a feature request, although I don't know how
achievable it is given the fact that every sniff may want different
settings during testing and it has to run from an SVN checkout as well.


Previous Comments:
------------------------------------------------------------------------

[2010-09-21 05:27:07] paladin

Description:
------------
BTW, this bug also affects 1.2.2

Created a custom controlstructure sniff based on tab_width=4
in config file. Runs fine from cmd
line, unit tests fail.

when the line:

echo
print_r($GLOBALS['PHP_CODESNIFFER_CONFIG_DATA'],1);

is placed in the sniff, it echoes the tab_width setting when run
from the command line, and
issues the exception "An unexpected exception has been
caught: Undefined index:
PHP_CODESNIFFER_CONFIG_DATA" when run in unit testing
with the command:

phpunit tests/AllTests.php

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedSep 21, '10 at 6:35a
activeSep 21, '10 at 6:35a
posts1
users1
websitepear.php.net

1 user in discussion

Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase