Skip to content

Commit

Permalink
Add behat test for new argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Sep 19, 2024
1 parent 54bb277 commit 8cf779f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion includes/Checker/Abstract_Check_Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ abstract class Abstract_Check_Runner implements Check_Runner {
* The forced slug to compare.
*
* @since 1.2.0
* @var array
* @var string
*/
protected $forced_slug;

Expand Down
31 changes: 31 additions & 0 deletions tests/behat/features/plugin-check.feature
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,37 @@ Feature: Test that the WP-CLI command works.
no_plugin_readme
"""

Scenario: Check a plugin from external location with custom plugin slug
Given a WP install with the Plugin Check plugin
And an empty external-folder/pxzvccv345nhg directory
And a external-folder/pxzvccv345nhg/foo-sample.php file:
"""
<?php
/**
* Plugin Name: Foo Sample
* Plugin URI: https://foo-sample.com
* Description:
* Version: 0.1.0
* Author:
* Author URI:
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: foo-sample
*/
"""

When I run the WP-CLI command `plugin check {RUN_DIR}/external-folder/pxzvccv345nhg/ --format=csv --fields=code,type --force-slug=foo-sample`
Then STDERR should be empty
And STDOUT should not contain:
"""
textdomain_mismatch,WARNING
"""
And STDOUT should contain:
"""
no_plugin_readme,WARNING
"""

Scenario: Check a plugin from external location but with invalid plugin
Given a WP install with the Plugin Check plugin
And an empty external-folder/foo-plugin directory
Expand Down

0 comments on commit 8cf779f

Please sign in to comment.