Skip to content

Commit

Permalink
Add feature tests for the exclude-codes argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Jan 15, 2025
1 parent c19f7b8 commit 896ba14
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/behat/features/plugin-check.feature
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,36 @@ Feature: Test that the WP-CLI command works.
WordPress.Security.EscapeOutput.OutputNotEscaped
"""

When I run the WP-CLI command `plugin check foo-single.php --exclude-codes=WordPress.WP.AlternativeFunctions.rand_mt_rand`
Then STDOUT should not contain:
"""
WordPress.WP.AlternativeFunctions.rand_mt_rand
"""
And STDOUT should contain:
"""
WordPress.Security.EscapeOutput.OutputNotEscaped
"""

When I run the WP-CLI command `plugin check foo-single.php --exclude-codes=WordPress.Security.EscapeOutput.OutputNotEscaped`
Then STDOUT should not contain:
"""
WordPress.Security.EscapeOutput.OutputNotEscaped
"""
And STDOUT should contain:
"""
WordPress.WP.AlternativeFunctions.rand_mt_rand
"""

When I run the WP-CLI command `plugin check foo-single.php --exclude-codes="WordPress.WP.AlternativeFunctions.rand_mt_rand,WordPress.Security.EscapeOutput.OutputNotEscaped"`
Then STDOUT should not contain:
"""
WordPress.Security.EscapeOutput.OutputNotEscaped
"""
And STDOUT should not contain:
"""
WordPress.WP.AlternativeFunctions.rand_mt_rand
"""

Scenario: Check plugin with special chars in plugin name
Given a WP install with the Plugin Check plugin
And a wp-content/plugins/johns-post-counter/johns-post-counter.php file:
Expand Down

0 comments on commit 896ba14

Please sign in to comment.