Skip to content

Commit 72ee662

Browse files
committed
Simplify tests all over again
1 parent 70efcdc commit 72ee662

9 files changed

+6
-164
lines changed

features/plugin-activate.feature

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ Feature: Activate WordPress plugins
8787
"""
8888
And STDERR should be empty
8989

90-
# Disabled for SQLite because this tests a scenario with an empty plugins directory,
91-
# so the SQLite integration plugin would be missing.
92-
@require-mysql
9390
Scenario: Not giving a slug on activate should throw an error unless --all given
9491
When I try `wp plugin activate`
9592
Then the return code should be 1
@@ -143,10 +140,6 @@ Feature: Activate WordPress plugins
143140
"""
144141
And the return code should be 0
145142

146-
# Disabled for SQLite because the SQLite plugin attempts to do a redirect,
147-
# which would cause the "Success" check to fail.
148-
# See https://github.com/WordPress/sqlite-database-integration/issues/49
149-
@require-mysql
150143
Scenario: Excluding a missing plugin should not throw an error
151144
Given a WP install
152145
And I run `wp plugin activate --all --exclude=missing-plugin`

features/plugin-auto-updates-disable.feature

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Feature: Disable auto-updates for WordPress plugins
4444
"""
4545
And the return code should be 0
4646

47-
@require-wp-5.5 @require-mysql
47+
@require-wp-5.5
4848
Scenario: Disable auto-updates for already disabled plugins
4949
When I run `wp plugin auto-updates disable hello`
5050
And I try `wp plugin auto-updates disable --all`
@@ -57,19 +57,6 @@ Feature: Disable auto-updates for WordPress plugins
5757
Error: Only disabled 2 of 3 plugin auto-updates.
5858
"""
5959

60-
@require-wp-5.5 @require-sqlite
61-
Scenario: Disable auto-updates for already disabled plugins
62-
When I run `wp plugin auto-updates disable hello`
63-
And I try `wp plugin auto-updates disable --all`
64-
Then STDERR should contain:
65-
"""
66-
Warning: Auto-updates already disabled for plugin hello.
67-
"""
68-
And STDERR should contain:
69-
"""
70-
Error: Only disabled 3 of 4 plugin auto-updates.
71-
"""
72-
7360
@require-wp-5.5
7461
Scenario: Filter when disabling auto-updates for already enabled plugins
7562
When I run `wp plugin auto-updates disable hello`

features/plugin-auto-updates-enable.feature

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Feature: Enable auto-updates for WordPress plugins
4343
"""
4444
And the return code should be 0
4545

46-
@require-wp-5.5 @require-mysql
46+
@require-wp-5.5
4747
Scenario: Enable auto-updates for already enabled plugins
4848
When I run `wp plugin auto-updates enable hello`
4949
And I try `wp plugin auto-updates enable --all`
@@ -56,19 +56,6 @@ Feature: Enable auto-updates for WordPress plugins
5656
Error: Only enabled 2 of 3 plugin auto-updates.
5757
"""
5858

59-
@require-wp-5.5 @require-sqlite
60-
Scenario: Enable auto-updates for already enabled plugins
61-
When I run `wp plugin auto-updates enable hello`
62-
And I try `wp plugin auto-updates enable --all`
63-
Then STDERR should contain:
64-
"""
65-
Warning: Auto-updates already enabled for plugin hello.
66-
"""
67-
And STDERR should contain:
68-
"""
69-
Error: Only enabled 3 of 4 plugin auto-updates.
70-
"""
71-
7259
@require-wp-5.5
7360
Scenario: Filter when enabling auto-updates for already enabled plugins
7461
When I run `wp plugin auto-updates enable hello`

features/plugin-auto-updates-status.feature

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,14 @@ Feature: Show the status of auto-updates for WordPress plugins
8181
Error: --enabled-only and --disabled-only are mutually exclusive and cannot be used at the same time.
8282
"""
8383

84-
@require-wp-5.5 @require-mysql
85-
Scenario: The fields can be shown individually
86-
Given I run `wp plugin auto-updates enable hello`
87-
88-
When I run `wp plugin auto-updates status --all --disabled-only --field=name`
89-
Then STDOUT should be:
90-
"""
91-
akismet
92-
duplicate-post
93-
"""
94-
95-
When I run `wp plugin auto-updates status hello --field=status`
96-
Then STDOUT should be:
97-
"""
98-
enabled
99-
"""
100-
101-
@require-wp-5.5 @require-sqlite
84+
@require-wp-5.5
10285
Scenario: The fields can be shown individually
10386
Given I run `wp plugin auto-updates enable hello`
10487

10588
When I run `wp plugin auto-updates status --all --disabled-only --field=name`
10689
Then STDOUT should be:
10790
"""
10891
akismet
109-
sqlite-database-integration
11092
duplicate-post
11193
"""
11294

@@ -116,7 +98,7 @@ Feature: Show the status of auto-updates for WordPress plugins
11698
enabled
11799
"""
118100

119-
@require-wp-5.5 @require-mysql
101+
@require-wp-5.5
120102
Scenario: Formatting options work
121103
When I run `wp plugin auto-updates status --all --format=json`
122104
Then STDOUT should be:
@@ -132,21 +114,3 @@ Feature: Show the status of auto-updates for WordPress plugins
132114
hello,disabled
133115
duplicate-post,disabled
134116
"""
135-
136-
@require-wp-5.5 @require-sqlite
137-
Scenario: Formatting options work
138-
When I run `wp plugin auto-updates status --all --format=json`
139-
Then STDOUT should be:
140-
"""
141-
[{"name":"akismet","status":"disabled"},{"name":"hello","status":"disabled"},{"name":"sqlite-database-integration","status":"disabled"},{"name":"duplicate-post","status":"disabled"}]
142-
"""
143-
144-
When I run `wp plugin auto-updates status --all --format=csv`
145-
Then STDOUT should be:
146-
"""
147-
name,status
148-
akismet,disabled
149-
hello,disabled
150-
sqlite-database-integration,disabled
151-
duplicate-post,disabled
152-
"""

features/plugin-deactivate.feature

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ Feature: Deactivate WordPress plugins
5858
Plugin 'akismet' deactivated.
5959
"""
6060

61-
# Disabled for SQLite because this tests a scenario with an empty plugins directory,
62-
# so the SQLite integration plugin would be missing.
63-
@require-mysql
6461
Scenario: Not giving a slug on deactivate should throw an error unless --all given
6562
When I try `wp plugin deactivate`
6663
Then the return code should be 1
@@ -80,7 +77,6 @@ Feature: Deactivate WordPress plugins
8077
Success: No plugins deactivated.
8178
"""
8279

83-
@require-mysql
8480
Scenario: Adding --exclude with plugin deactivate --all should exclude the plugins specified via --exclude
8581
When I try `wp plugin deactivate --all --exclude=hello`
8682
Then STDOUT should be:
@@ -90,16 +86,6 @@ Feature: Deactivate WordPress plugins
9086
"""
9187
And the return code should be 0
9288

93-
@require-sqlite
94-
Scenario: Adding --exclude with plugin deactivate --all should exclude the plugins specified via --exclude
95-
When I try `wp plugin deactivate --all --exclude=hello`
96-
Then STDOUT should be:
97-
"""
98-
Plugin 'akismet' deactivated.
99-
Success: Deactivated 1 of 2 plugins.
100-
"""
101-
And the return code should be 0
102-
10389
Scenario: Adding --exclude with plugin deactivate should throw an error unless --all given
10490
When I try `wp plugin deactivate --exclude=hello`
10591
Then the return code should be 1

features/plugin-delete.feature

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ Feature: Delete WordPress plugins
1212
"""
1313
And the return code should be 0
1414

15-
# Disabled for SQLite because this tests a scenario with an empty plugins directory,
16-
# so the SQLite integration plugin would be missing.
17-
@require-mysql
1815
Scenario: Delete all installed plugins
1916
When I run `wp plugin delete --all`
2017
Then STDOUT should be:
@@ -43,7 +40,6 @@ Feature: Delete WordPress plugins
4340
"""
4441
And the return code should be 0
4542

46-
@require-mysql
4743
Scenario: Excluding a plugin from deletion when using --all switch
4844
When I try `wp plugin delete --all --exclude=akismet,hello`
4945
Then STDOUT should be:
@@ -52,15 +48,6 @@ Feature: Delete WordPress plugins
5248
"""
5349
And the return code should be 0
5450

55-
@require-sqlite
56-
Scenario: Excluding a plugin from deletion when using --all switch
57-
When I try `wp plugin delete --all --exclude=akismet,hello,sqlite-database-integration`
58-
Then STDOUT should be:
59-
"""
60-
Success: No plugins deleted.
61-
"""
62-
And the return code should be 0
63-
6451
Scenario: Excluding a missing plugin should not throw an error
6552
Given a WP install
6653
And I run `wp plugin delete --all --exclude=missing-plugin`

features/plugin-uninstall.feature

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Feature: Uninstall a WordPress plugin
3434
"""
3535
And the return code should be 1
3636

37-
@require-mysql
3837
Scenario: Uninstall all installed plugins
3938
When I run `wp plugin uninstall --all`
4039
Then STDOUT should be:
@@ -51,23 +50,6 @@ Feature: Uninstall a WordPress plugin
5150
Success: No plugins uninstalled.
5251
"""
5352

54-
# Not running the previous command again in this test
55-
# because the SQLite integration plugin is missing after the first run.
56-
@require-sqlite
57-
Scenario: Uninstall all installed plugins
58-
When I run `wp plugin uninstall --all`
59-
Then STDOUT should be:
60-
"""
61-
Uninstalled and deleted 'akismet' plugin.
62-
Uninstalled and deleted 'hello' plugin.
63-
Uninstalled and deleted 'sqlite-database-integration' plugin.
64-
Success: Uninstalled 3 of 3 plugins.
65-
"""
66-
And the return code should be 0
67-
68-
# Disabled for SQLite because this test uninstalls all plugins,
69-
# including the SQLite integration plugin.
70-
@require-mysql
7153
Scenario: Uninstall all installed plugins when one or more activated
7254
When I run `wp plugin activate --all`
7355
Then STDOUT should contain:
@@ -90,7 +72,6 @@ Feature: Uninstall a WordPress plugin
9072
Success: Uninstalled 2 of 2 plugins.
9173
"""
9274

93-
@require-mysql
9475
Scenario: Excluding a plugin from uninstallation when using --all switch
9576
When I try `wp plugin uninstall --all --exclude=akismet,hello`
9677
Then STDOUT should be:
@@ -99,15 +80,6 @@ Feature: Uninstall a WordPress plugin
9980
"""
10081
And the return code should be 0
10182

102-
@require-sqlite
103-
Scenario: Excluding a plugin from uninstallation when using --all switch
104-
When I try `wp plugin uninstall --all --exclude=akismet,hello,sqlite-database-integration`
105-
Then STDOUT should be:
106-
"""
107-
Success: No plugins uninstalled.
108-
"""
109-
And the return code should be 0
110-
11183
Scenario: Excluding a missing plugin should not throw an error
11284
Given a WP install
11385
And I run `wp plugin uninstall --all --exclude=missing-plugin`

features/plugin-update.feature

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ Feature: Update WordPress plugins
112112
2.6.1
113113
"""
114114

115-
# Disabled for SQLite because this tests a scenario with an empty plugins directory,
116-
# so the SQLite integration plugin would be missing.
117-
@require-wp-5.2 @require-mysql
115+
@require-wp-5.2
118116
Scenario: Not giving a slug on update should throw an error unless --all given
119117
Given a WP install
120118
And I run `wp plugin path`

features/plugin.feature

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ Feature: Manage WordPress plugins
297297
"""
298298
And the return code should be 0
299299

300-
@require-mysql
301300
Scenario: List plugins
302301
Given a WP install
303302

@@ -318,30 +317,6 @@ Feature: Manage WordPress plugins
318317
Automattic
319318
"""
320319

321-
@require-sqlite
322-
Scenario: List plugins
323-
Given a WP install
324-
325-
When I run `wp plugin activate akismet hello`
326-
Then STDOUT should not be empty
327-
328-
When I run `wp plugin list --status=inactive --field=name`
329-
Then STDOUT should contain:
330-
"""
331-
sqlite-database-integration
332-
"""
333-
334-
When I run `wp plugin list --status=active --fields=name,status,file`
335-
Then STDOUT should be a table containing rows:
336-
| name | status | file |
337-
| akismet | active | akismet/akismet.php |
338-
339-
When I run `wp plugin list --status=active --field=author`
340-
Then STDOUT should contain:
341-
"""
342-
Automattic
343-
"""
344-
345320
Scenario: List plugin by multiple statuses
346321
Given a WP multisite install
347322
And a wp-content/plugins/network-only.php file:
@@ -398,9 +373,6 @@ Feature: Manage WordPress plugins
398373
| name | status | update |
399374
| wordpress-importer | inactive | none |
400375

401-
# Disabled for SQLite because this tests a scenario with an empty plugins directory,
402-
# so the SQLite integration plugin would be missing.
403-
@require-mysql
404376
Scenario: Install a plugin when directory doesn't yet exist
405377
Given a WP install
406378

@@ -425,8 +397,6 @@ Feature: Manage WordPress plugins
425397
Installing Debug Bar List Script & Style Dependencies
426398
"""
427399

428-
# Disabled for SQLite because this tests a specific list of plugins.
429-
@require-mysql
430400
Scenario: Enable and disable all plugins
431401
Given a WP install
432402

@@ -649,9 +619,7 @@ Feature: Manage WordPress plugins
649619
| name | title | description | file |
650620
| db-error.php | | Custom database error message. | db-error.php |
651621

652-
# Disabled for SQLite because this test uninstalls all plugins,
653-
# including the SQLite integration plugin.
654-
@require-wp-4.0 @require-mysql
622+
@require-wp-4.0
655623
Scenario: Validate installed plugin's version.
656624
Given a WP installation
657625
And I run `wp plugin uninstall --all`

0 commit comments

Comments
 (0)