11Feature : Granular cache flushing operations
22
33 @skip-object-cache
4- Scenario : Flush post cache
4+ Scenario : Flush specific post cache
55 Given a WP install
66 And a wp-content/mu-plugins/test-harness.php file:
77 """
@@ -13,20 +13,24 @@ Feature: Granular cache flushing operations
1313 WP_CLI::add_hook( 'before_invoke:cache flush-post', $cache_post );
1414 """
1515
16- When I run `wp cache flush-post`
16+ When I run `wp cache flush-post 123 `
1717 Then STDOUT should contain:
1818 """
19- Success: Post caches cleared.
19+ Success: Post cache for ID 123 cleared.
2020 """
2121
22- When I run `wp cache flush-post 123`
23- Then STDOUT should contain:
22+ @skip-object-cache
23+ Scenario : Flush all posts cache requires support
24+ Given a WP install
25+
26+ When I try `wp cache flush-post`
27+ Then STDERR should contain:
2428 """
25- Success: Post cache for ID 123 cleared.
29+ Flushing all post caches requires WordPress 6.1+
2630 """
2731
2832 @skip-object-cache
29- Scenario : Flush term cache
33+ Scenario : Flush specific term cache
3034 Given a WP install
3135 And a wp-content/mu-plugins/test-harness.php file:
3236 """
@@ -38,20 +42,24 @@ Feature: Granular cache flushing operations
3842 WP_CLI::add_hook( 'before_invoke:cache flush-term', $cache_term );
3943 """
4044
41- When I run `wp cache flush-term`
45+ When I run `wp cache flush-term 5 `
4246 Then STDOUT should contain:
4347 """
44- Success: Term caches cleared.
48+ Success: Term cache for ID 5 cleared.
4549 """
4650
47- When I run `wp cache flush-term 5`
48- Then STDOUT should contain:
51+ @skip-object-cache
52+ Scenario : Flush all terms cache requires support
53+ Given a WP install
54+
55+ When I try `wp cache flush-term`
56+ Then STDERR should contain:
4957 """
50- Success: Term cache for ID 5 cleared.
58+ Flushing all term caches requires WordPress 6.1+
5159 """
5260
5361 @skip-object-cache
54- Scenario : Flush comment cache
62+ Scenario : Flush specific comment cache
5563 Given a WP install
5664 And a wp-content/mu-plugins/test-harness.php file:
5765 """
@@ -63,20 +71,24 @@ Feature: Granular cache flushing operations
6371 WP_CLI::add_hook( 'before_invoke:cache flush-comment', $cache_comment );
6472 """
6573
66- When I run `wp cache flush-comment`
74+ When I run `wp cache flush-comment 42 `
6775 Then STDOUT should contain:
6876 """
69- Success: Comment caches cleared.
77+ Success: Comment cache for ID 42 cleared.
7078 """
7179
72- When I run `wp cache flush-comment 42`
73- Then STDOUT should contain:
80+ @skip-object-cache
81+ Scenario : Flush all comments cache requires support
82+ Given a WP install
83+
84+ When I try `wp cache flush-comment`
85+ Then STDERR should contain:
7486 """
75- Success: Comment cache for ID 42 cleared.
87+ Flushing all comment caches requires WordPress 6.1+
7688 """
7789
7890 @skip-object-cache
79- Scenario : Flush user cache
91+ Scenario : Flush specific user cache
8092 Given a WP install
8193 And a wp-content/mu-plugins/test-harness.php file:
8294 """
@@ -88,20 +100,24 @@ Feature: Granular cache flushing operations
88100 WP_CLI::add_hook( 'before_invoke:cache flush-user', $cache_user );
89101 """
90102
91- When I run `wp cache flush-user`
103+ When I run `wp cache flush-user 1 `
92104 Then STDOUT should contain:
93105 """
94- Success: User caches cleared.
106+ Success: User cache for ID 1 cleared.
95107 """
96108
97- When I run `wp cache flush-user 1`
98- Then STDOUT should contain:
109+ @skip-object-cache
110+ Scenario : Flush all users cache requires support
111+ Given a WP install
112+
113+ When I try `wp cache flush-user`
114+ Then STDERR should contain:
99115 """
100- Success: User cache for ID 1 cleared.
116+ Flushing all user caches requires WordPress 6.1+
101117 """
102118
103119 @skip-object-cache
104- Scenario : Flush option cache
120+ Scenario : Flush specific option cache
105121 Given a WP install
106122 And a wp-content/mu-plugins/test-harness.php file:
107123 """
@@ -113,14 +129,19 @@ Feature: Granular cache flushing operations
113129 WP_CLI::add_hook( 'before_invoke:cache flush-option', $cache_option );
114130 """
115131
116- When I run `wp cache flush-option`
132+ When I run `wp cache flush-option my_option `
117133 Then STDOUT should contain:
118134 """
119- Success: Option caches cleared.
135+ Success: Option cache for 'my_option' cleared.
120136 """
121137
122- When I run `wp cache flush-option my_option`
123- Then STDOUT should contain:
138+ @skip-object-cache
139+ Scenario : Flush all options cache requires support
140+ Given a WP install
141+
142+ When I try `wp cache flush-option`
143+ Then STDERR should contain:
124144 """
125- Success: Option cache for 'my_option' cleared.
145+ Flushing all option caches requires WordPress 6.1+
126146 """
147+
0 commit comments