-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
3.0: Tests: add a bootstrap file #1907
Conversation
While not strictly necessary, it makes life easier to have this bootstrap in place. The bootstrap file will: * Load the PHPCS autoloader (was previously done from the command-line); * Load the Composer autoload file. * Will automatically set the `PHPCS_IGNORE_TESTS` environment variable to the correct value to prevent running tests from other standards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For locally running the tests with a git clone of PHPCS, a phpunit.xml overload file can be used with a env variable PHPCS_DIR to point the bootstrap to that install. Do make sure that PHPCSUtils is installed and registered in the installed_paths of that install if you do so.
Should we put this in a readme or wiki, just not to forget about it and to point people to, if it pops up in the issues?
@dingo-d I fully agree, though I think it should go in the I already have this written up, or rather, I have a local commit with:
As the So as per my note in #1905:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delayed review - there was a bit more going on in this PR, and I wanted to have the time to get my head around what was actually happening.
I wonder if PHPCSExtra / PHPCSUtils could handle a generic version of this logic in a function - find PHPCS directory, autoload PHPCS files, ignore all but a standard passed in as a string - so that WPCS and other standards packages could simply call |
@GaryJones No worries, I just wanted to make sure (with the review request) it had not been overlooked/escaped attention.
I like the idea - would be something for PHPCSUtils. I will need to have a think about it. Might be good to open an issue about it in that repo. There is a related issue open already to create a PHP/PHPCS/PHPUnit cross-version compatible alternative to the PHPCS native base test class |
While not strictly necessary, it makes life easier to have this bootstrap in place.
The bootstrap file will:
PHPCS_IGNORE_TESTS
environment variable to the correct value to prevent running tests from other standards.For locally running the tests after having run
composer install
, all should work fine.For locally running the tests with a git clone of PHPCS, a
phpunit.xml
overload file can be used with aenv
variablePHPCS_DIR
to point the bootstrap to that install. Do make sure that PHPCSUtils is installed and registered in theinstalled_paths
of that install if you do so.