@@ -8,6 +8,7 @@ Feature: Patch command available for the object cache
88 $set_foo = function(){
99 wp_cache_set( 'my_key', ['foo' => 'bar'] );
1010 wp_cache_set( 'other_key', ['fuz' => 'biz'] );
11+ wp_cache_set( 'my_key_in_group', ['fuz' => 'biz'], 'my_group' );
1112
1213 $complex_key = (object) [
1314 'foo' => (object) [
@@ -34,12 +35,24 @@ Feature: Patch command available for the object cache
3435 Success: Updated cache key 'complex_key'.
3536 """
3637
38+ When I try `wp cache patch insert my_key_in_group foo bar --group=my_group`
39+ Then STDOUT should be:
40+ """
41+ Success: Updated cache key 'my_key_in_group'.
42+ """
43+
3744 When I try `wp cache patch insert unknown_key foo bar`
3845 Then STDERR should be:
3946 """
4047 Error: Cannot create key "foo" on data type boolean
4148 """
4249
50+ When I try `wp cache patch insert other_key foo bar --group=unknown_group`
51+ Then STDERR should be:
52+ """
53+ Error: Cannot create key "foo" on data type boolean
54+ """
55+
4356 When I run `wp cache patch update my_key foo test`
4457 Then STDOUT should be:
4558 """
@@ -58,6 +71,12 @@ Feature: Patch command available for the object cache
5871 Success: Updated cache key 'complex_key'.
5972 """
6073
74+ When I try `wp cache patch update my_key_in_group fuz baz --group=my_group`
75+ Then STDOUT should be:
76+ """
77+ Success: Updated cache key 'my_key_in_group'.
78+ """
79+
6180 When I try `wp cache patch update unknown_key foo test`
6281 Then STDERR should be:
6382 """
@@ -70,12 +89,24 @@ Feature: Patch command available for the object cache
7089 Error: No data exists for key "bar"
7190 """
7291
92+ When I try `wp cache patch update my_key foo baz --expiration=60`
93+ Then STDOUT should be:
94+ """
95+ Success: Updated cache key 'my_key'.
96+ """
97+
7398 When I run `wp cache patch delete my_key foo`
7499 Then STDOUT should be:
75100 """
76101 Success: Updated cache key 'my_key'.
77102 """
78103
104+ When I try `wp cache patch delete my_key_in_group fuz --group=my_group`
105+ Then STDOUT should be:
106+ """
107+ Success: Updated cache key 'my_key_in_group'.
108+ """
109+
79110 When I try `wp cache patch delete unknown_key foo`
80111 Then STDERR should be:
81112 """
@@ -87,3 +118,9 @@ Feature: Patch command available for the object cache
87118 """
88119 Error: No data exists for key "bar"
89120 """
121+
122+ When I try `wp cache patch delete my_key foo --group=my_group`
123+ Then STDERR should be:
124+ """
125+ Error: No data exists for key "foo"
126+ """
0 commit comments