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

Fix: Fatal error when in checks in --checks and --exclude-checks overlaps #387

Merged
merged 3 commits into from Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions includes/Checker/Abstract_Check_Runner.php
Expand Up @@ -419,9 +419,7 @@ final public function get_checks_to_run() {
$collection = Check_Categories::filter_checks_by_categories( $collection, $categories );
}

return $collection
->require( $check_slugs ) // Ensures all of the given slugs are valid.
mukeshpanchal27 marked this conversation as resolved.
Show resolved Hide resolved
->to_map();
return $collection->to_map();
}

/**
Expand Down
9 changes: 9 additions & 0 deletions tests/behat/features/plugin-check.feature
Expand Up @@ -84,6 +84,15 @@ Feature: Test that the WP-CLI command works.
"""
WordPress.WP.AlternativeFunctions.rand_mt_rand
"""
When I run the WP-CLI command `plugin check hello.php --checks=plugin_review_phpcs,late_escaping --exclude-checks=late_escaping`
Then STDOUT should contain:
"""
WordPress.WP.AlternativeFunctions.rand_mt_rand
"""
And STDOUT should not contain:
"""
WordPress.Security.EscapeOutput.OutputNotEscaped
"""

Scenario: Check Akismet
Given a WP install with the Plugin Check plugin
Expand Down