Skip to content

Commit 2eeb047

Browse files
committed
Remove some test duplication
1 parent 19f45ab commit 2eeb047

File tree

2 files changed

+18
-43
lines changed

2 files changed

+18
-43
lines changed

features/plugin-auto-updates-disable.feature

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,15 @@ Feature: Disable auto-updates for WordPress plugins
3232
"""
3333
And the return code should be 0
3434

35-
@require-wp-5.5 @require-mysql
35+
@require-wp-5.5
3636
Scenario: Disable auto-updates for all plugins
37-
When I run `wp plugin auto-updates disable --all`
38-
Then STDOUT should be:
39-
"""
40-
Success: Disabled 3 of 3 plugin auto-updates.
41-
"""
42-
And the return code should be 0
37+
When I run `wp plugin list --status=active --format=count`
38+
Then save STDOUT as {PLUGIN_COUNT}
4339

44-
@require-wp-5.5 @require-sqlite
45-
Scenario: Disable auto-updates for all plugins
4640
When I run `wp plugin auto-updates disable --all`
4741
Then STDOUT should be:
4842
"""
49-
Success: Disabled 4 of 4 plugin auto-updates.
43+
Success: Disabled {PLUGIN_COUNT} of {PLUGIN_COUNT} plugin auto-updates.
5044
"""
5145
And the return code should be 0
5246

@@ -76,23 +70,17 @@ Feature: Disable auto-updates for WordPress plugins
7670
Error: Only disabled 3 of 4 plugin auto-updates.
7771
"""
7872

79-
@require-wp-5.5 @require-mysql
73+
@require-wp-5.5
8074
Scenario: Filter when enabling auto-updates for already disabled plugins
8175
When I run `wp plugin auto-updates disable hello`
82-
And I run `wp plugin auto-updates disable --all --enabled-only`
83-
Then STDOUT should be:
84-
"""
85-
Success: Disabled 2 of 2 plugin auto-updates.
86-
"""
87-
And the return code should be 0
8876

89-
@require-wp-5.5 @require-sqlite
90-
Scenario: Filter when enabling auto-updates for already disabled plugins
91-
When I run `wp plugin auto-updates disable hello`
92-
And I run `wp plugin auto-updates disable --all --enabled-only`
77+
When I run `wp plugin list --status=active --format=count`
78+
Then save STDOUT as {PLUGIN_COUNT}
79+
80+
When I run `wp plugin auto-updates disable --all --enabled-only`
9381
Then STDOUT should be:
9482
"""
95-
Success: Disabled 3 of 3 plugin auto-updates.
83+
Success: Disabled {PLUGIN_COUNT} of {PLUGIN_COUNT} plugin auto-updates.
9684
"""
9785
And the return code should be 0
9886

features/plugin-auto-updates-enable.feature

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,15 @@ Feature: Enable auto-updates for WordPress plugins
3131
"""
3232
And the return code should be 0
3333

34-
@require-wp-5.5 @require-mysql
34+
@require-wp-5.5
3535
Scenario: Enable auto-updates for all plugins
36-
When I run `wp plugin auto-updates enable --all`
37-
Then STDOUT should be:
38-
"""
39-
Success: Enabled 3 of 3 plugin auto-updates.
40-
"""
41-
And the return code should be 0
36+
When I run `wp plugin list --status=active --format=count`
37+
Then save STDOUT as {PLUGIN_COUNT}
4238

43-
@require-wp-5.5 @require-sqlite
44-
Scenario: Enable auto-updates for all plugins
4539
When I run `wp plugin auto-updates enable --all`
4640
Then STDOUT should be:
4741
"""
48-
Success: Enabled 4 of 4 plugin auto-updates.
42+
Success: Enabled {PLUGIN_COUNT} of {PLUGIN_COUNT} plugin auto-updates.
4943
"""
5044
And the return code should be 0
5145

@@ -75,23 +69,16 @@ Feature: Enable auto-updates for WordPress plugins
7569
Error: Only enabled 3 of 4 plugin auto-updates.
7670
"""
7771

78-
@require-wp-5.5 @require-mysql
72+
@require-wp-5.5
7973
Scenario: Filter when enabling auto-updates for already enabled plugins
80-
When I run `wp plugin auto-updates enable hello`
81-
And I run `wp plugin auto-updates enable --all --disabled-only`
82-
Then STDOUT should be:
83-
"""
84-
Success: Enabled 2 of 2 plugin auto-updates.
85-
"""
86-
And the return code should be 0
74+
When I run `wp plugin list --status=active --format=count`
75+
Then save STDOUT as {PLUGIN_COUNT}
8776

88-
@require-wp-5.5 @require-sqlite
89-
Scenario: Filter when enabling auto-updates for already enabled plugins
9077
When I run `wp plugin auto-updates enable hello`
9178
And I run `wp plugin auto-updates enable --all --disabled-only`
9279
Then STDOUT should be:
9380
"""
94-
Success: Enabled 3 of 3 plugin auto-updates.
81+
Success: Enabled {PLUGIN_COUNT} of {PLUGIN_COUNT} plugin auto-updates.
9582
"""
9683
And the return code should be 0
9784

0 commit comments

Comments
 (0)