Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running the unit tests with a phpunit config file breaks the test suite #1447

Closed
jrfnl opened this issue May 7, 2017 · 4 comments
Closed
Milestone

Comments

@jrfnl
Copy link
Contributor

jrfnl commented May 7, 2017

Running the unit tests with a custom phpunit config file like:
phpunit -c customphpunit.xml

breaks the unit test suite quite badly (sniffs can no longer be tested) with the following backtrace:

PHP_CodeSniffer\Exceptions\RuntimeException: ERROR: unable to get value of property "values"

PHP_CodeSniffer\src\Config.php:183
PHP_CodeSniffer\src\Config.php:638
PHP_CodeSniffer\src\Config.php:414
PHP_CodeSniffer\src\Config.php:324
PHP_CodeSniffer\tests\Standards\AbstractSniffUnitTest.php:134
PHP_CodeSniffer\tests\TestSuite.php:26

Some light debugging shows that the Config::processShortArgument() method chokes on the -c.

This used to work fine with PHPCS 2.x

@jrfnl jrfnl changed the title PHPCS3: Running the unit tests with a phpunit config file break the test suite PHPCS3: Running the unit tests with a phpunit config file breaks the test suite May 7, 2017
@gsherwood gsherwood changed the title PHPCS3: Running the unit tests with a phpunit config file breaks the test suite Running the unit tests with a phpunit config file breaks the test suite May 8, 2017
gsherwood added a commit that referenced this issue May 8, 2017
@gsherwood
Copy link
Member

The code to handle unknown CLI args didn't work in 3.0 due to some extra checks. I've added a specific setting unknown to store all the unknown args when they are being ignored (like during unit testing).

Thanks for reporting this.

@jrfnl
Copy link
Contributor Author

jrfnl commented May 8, 2017

Thanks for the quick fix!

@wimg
Copy link
Contributor

wimg commented Jun 9, 2017

@gsherwood : Any idea when 3.0.1 would be released ? Just to know if we can include the upgrade PHPCS to 3.x in the PHPCompatibility 7.1.5 release or we need to wait for 7.1.6.

@gsherwood
Copy link
Member

@wimg I'm aiming for next week. Just finished up the last few things yesterday.

@gsherwood gsherwood added this to the 3.0.1 milestone Jun 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants