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

PHPUnit: Fix regex in bootstrap file #224

Merged
merged 1 commit into from
Oct 1, 2024
Merged

Conversation

swissspidy
Copy link
Member

The current regex doesn't work if all the attributes in the PHPUnit config file are on one line.

@swissspidy swissspidy added bug Something isn't working scope:testing labels Oct 1, 2024
@swissspidy swissspidy added this to the 4.3.4 milestone Oct 1, 2024
@swissspidy swissspidy requested a review from a team as a code owner October 1, 2024 13:42
@swissspidy swissspidy merged commit a8de3f0 into main Oct 1, 2024
40 of 42 checks passed
@swissspidy swissspidy deleted the fix/bootstrap-regex branch October 1, 2024 15:44
@@ -43,7 +43,7 @@ function wpcli_tests_include_config( array $config_filenames = [] ) {
if ( $config_filename ) {
$config = file_get_contents( $config_filename );
$matches = null;
$pattern = '/bootstrap="(?P<bootstrap>.*)"/';
$pattern = '/bootstrap="(?P<bootstrap>[^"]*)"/';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may still want to replace the * with a + to not match bootstrap="" (which should be rare or non-existent, but saves having to check for it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scope:testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants