Skip to content

Commit 476439f

Browse files
committed
Fix Gherkin lint issues
1 parent 131bb09 commit 476439f

16 files changed

+187
-196
lines changed

features/extension-install.feature

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
Feature: Manage WordPress extension installation
22

3-
@require-wp-5.1.1
4-
Scenario: Installing Extensions theme or plugin
5-
Given a WP install
3+
@require-wp-5.1.1
4+
Scenario: Installing Extensions theme or plugin
5+
Given a WP install
66

7-
When I try `wp theme install test-ext --activate`
8-
Then STDERR should be:
9-
"""
10-
Warning: test-ext: Theme not found
11-
Warning: The 'test-ext' theme could not be found.
12-
Error: No themes installed.
13-
"""
7+
When I try `wp theme install test-ext --activate`
8+
Then STDERR should be:
9+
"""
10+
Warning: test-ext: Theme not found
11+
Warning: The 'test-ext' theme could not be found.
12+
Error: No themes installed.
13+
"""
1414

15-
When I try `wp plugin install test-ext --activate`
16-
Then STDERR should be:
17-
"""
18-
Warning: test-ext: Plugin not found.
19-
Warning: The 'test-ext' plugin could not be found.
20-
Error: No plugins installed.
21-
"""
15+
When I try `wp plugin install test-ext --activate`
16+
Then STDERR should be:
17+
"""
18+
Warning: test-ext: Plugin not found.
19+
Warning: The 'test-ext' plugin could not be found.
20+
Error: No plugins installed.
21+
"""

features/plugin-activate.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Feature: Activate WordPress plugins
4949
unset( $all_plugins['site-secrets/site-secrets.php'] );
5050
return $all_plugins;
5151
} );
52-
"""
52+
"""
5353

5454
When I run `wp plugin activate --all`
5555
Then STDOUT should contain:
@@ -83,7 +83,7 @@ Feature: Activate WordPress plugins
8383
Plugin 'example-plugin' activated.
8484
Success: Activated 1 of 1 plugins.
8585
"""
86-
And STDERR should be empty
86+
And STDERR should be empty
8787

8888
Scenario: Not giving a slug on activate should throw an error unless --all given
8989
When I try `wp plugin activate`
@@ -115,7 +115,7 @@ Feature: Activate WordPress plugins
115115
* Author: WP-CLI tests
116116
* Requires PHP: 99.99
117117
*/
118-
"""
118+
"""
119119
And I run `wp plugin deactivate --all`
120120
And I run `wp cli info | grep "PHP version" | awk '{print $3}'`
121121
And save STDOUT as {PHP_VERSION}

features/plugin-auto-updates-disable.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ Feature: Disable auto-updates for WordPress plugins
6060
@require-wp-5.5
6161
Scenario: Filter when disabling auto-updates for already enabled plugins
6262
When I run `wp plugin auto-updates disable hello`
63-
64-
When I run `wp plugin list --auto_update=on --format=count`
63+
And I run `wp plugin list --auto_update=on --format=count`
6564
Then save STDOUT as {PLUGIN_COUNT}
6665

6766
When I run `wp plugin auto-updates disable --all --enabled-only`

features/plugin-deactivate.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ Feature: Deactivate WordPress plugins
5050
unset( $all_plugins['akismet/akismet.php'] );
5151
return $all_plugins;
5252
} );
53-
"""
53+
"""
5454

5555
When I run `wp plugin deactivate --all`
5656
Then STDOUT should not contain:
57-
"""
58-
Plugin 'akismet' deactivated.
59-
"""
57+
"""
58+
Plugin 'akismet' deactivated.
59+
"""
6060

6161
Scenario: Not giving a slug on deactivate should throw an error unless --all given
6262
When I try `wp plugin deactivate`

features/plugin-delete.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Feature: Delete WordPress plugins
7171
"""
7272
Error: No plugins deleted.
7373
"""
74-
Then STDOUT should not contain:
74+
And STDOUT should not contain:
7575
"""
7676
Success:
7777
"""
@@ -82,7 +82,7 @@ Feature: Delete WordPress plugins
8282
"""
8383
Error:
8484
"""
85-
Then STDOUT should contain:
85+
And STDOUT should contain:
8686
"""
8787
Success:
8888
"""

features/plugin-get.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Feature: Get WordPress plugin
1616
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
1717
* Text Domain: sample-plugin
1818
*/
19-
"""
19+
"""
2020

2121
When I run `wp plugin get foo --fields=name,author,version,status`
2222
Then STDOUT should be a table containing rows:
@@ -44,7 +44,7 @@ Feature: Get WordPress plugin
4444
* Author: John Doe
4545
* Requires Plugins: jetpack, woocommerce
4646
*/
47-
"""
47+
"""
4848

4949
When I run `wp plugin get foo --field=requires_plugins`
5050
Then STDOUT should be:
@@ -65,7 +65,7 @@ Feature: Get WordPress plugin
6565
* Requires at least: 6.2
6666
* Requires PHP: 7.4
6767
*/
68-
"""
68+
"""
6969

7070
When I run `wp plugin get foo --fields=requires_wp,requires_php`
7171
Then STDOUT should be a table containing rows:

features/plugin-install-github-latest.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Feature: Install WordPress plugins
1+
Feature: Install WordPress plugins from GitHub
22

33
Scenario: Verify that providing a plugin releases/latest GitHub URL will get the latest ZIP
44
Given a WP install

features/plugin-install.feature

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Feature: Install WordPress plugins
2828
"""
2929
Warning: Destination folder already exists
3030
"""
31-
Then STDERR should contain:
31+
And STDERR should contain:
3232
"""
3333
Error: No plugins installed.
3434
"""
@@ -227,16 +227,16 @@ Feature: Install WordPress plugins
227227

228228
When I try `wp plugin install site-secrets --activate`
229229
Then STDERR should contain:
230-
"""
231-
Warning: site-secrets: Plugin already installed.
232-
"""
230+
"""
231+
Warning: site-secrets: Plugin already installed.
232+
"""
233233

234234
And STDOUT should contain:
235-
"""
236-
Activating 'site-secrets'...
237-
Plugin 'site-secrets' activated.
238-
Success: Plugin already installed.
239-
"""
235+
"""
236+
Activating 'site-secrets'...
237+
Plugin 'site-secrets' activated.
238+
Success: Plugin already installed.
239+
"""
240240

241241
@require-php-7
242242
Scenario: Can't install plugin that requires a newer version of WordPress
@@ -247,26 +247,26 @@ Feature: Install WordPress plugins
247247

248248
And I try `wp plugin install wp-super-cache`
249249
Then STDERR should contain:
250-
"""
251-
Warning: wp-super-cache: This plugin does not work with your version of WordPress
252-
"""
250+
"""
251+
Warning: wp-super-cache: This plugin does not work with your version of WordPress
252+
"""
253253

254254
And STDERR should contain:
255-
"""
256-
Error: No plugins installed.
257-
"""
255+
"""
256+
Error: No plugins installed.
257+
"""
258258

259259
@less-than-php-7.4 @require-wp-6.6
260260
Scenario: Can't install plugin that requires a newer version of PHP
261261
Given a WP install
262262

263263
And I try `wp plugin install contact-form-7`
264264
Then STDERR should contain:
265-
"""
266-
Warning: contact-form-7: This plugin does not work with your version of PHP
267-
"""
265+
"""
266+
Warning: contact-form-7: This plugin does not work with your version of PHP
267+
"""
268268

269269
And STDERR should contain:
270-
"""
271-
Error: No plugins installed.
272-
"""
270+
"""
271+
Error: No plugins installed.
272+
"""

features/plugin-list-wporg-status.feature

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ Feature: Check the status of plugins on WordPress.org
33
@require-wp-5.2
44
Scenario: Install plugins and check the status on wp.org.
55
Given a WP install
6-
7-
When I run `wp plugin install wordpress-importer --version=0.5 --force`
6+
And I run `wp plugin install wordpress-importer --version=0.5 --force`
87
And I run `wp plugin install https://downloads.wordpress.org/plugin/no-longer-in-directory.1.0.62.zip`
98
And a wp-content/plugins/never-wporg/never-wporg.php file:
109
"""
@@ -13,7 +12,7 @@ Feature: Check the status of plugins on WordPress.org
1312
* Plugin Name: This plugin was never in the WordPress.org plugin directory
1413
* Version: 2.0.2
1514
*/
16-
"""
15+
"""
1716

1817
When I run `wp plugin list --name=wordpress-importer --field=wporg_last_updated`
1918
Then STDOUT should not be empty

features/plugin-update.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Feature: Update WordPress plugins
209209
"""
210210
Error:
211211
"""
212-
Then STDOUT should not contain:
212+
And STDOUT should not contain:
213213
"""
214214
Success:
215215
"""
@@ -220,7 +220,7 @@ Feature: Update WordPress plugins
220220
"""
221221
Error:
222222
"""
223-
Then STDOUT should contain:
223+
And STDOUT should contain:
224224
"""
225225
Success:
226226
"""

0 commit comments

Comments
 (0)