Repository navigation
Expand file tree
/
Copy pathnetwork-meta.feature
More file actions
84 lines (68 loc) · 1.88 KB
/
Copy pathnetwork-meta.feature
File metadata and controls
84 lines (68 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Feature: Manage network-wide custom fields.
Scenario: Non-multisite
Given a WP install
When I run `wp network meta`
Then STDOUT should contain:
"""
usage: wp network meta
"""
When I try `wp network meta get 1 site_admins`
Then STDOUT should be empty
And STDERR should contain:
"""
This is not a multisite install
"""
And the return code should be 1
Scenario: Network meta is actually network options
Given a WP multisite install
When I run `wp eval 'update_network_option( 1, "mykey", "123" );'`
And I run `wp eval 'echo get_network_option( 1, "mykey" );'`
Then STDOUT should be:
"""
123
"""
When I run `wp network meta update 1 mykey 456`
Then STDOUT should be:
"""
Success: Updated custom field 'mykey'.
"""
When I run `wp network meta get 1 mykey`
Then STDOUT should be:
"""
456
"""
When I run `wp eval 'echo get_network_option( 1, "mykey" );'`
Then STDOUT should be:
"""
456
"""
@require-object-cache
Scenario: Object cache correctly handles network meta updates
Given a WP multisite install
When I run `wp eval 'update_network_option( 1, "objkey", "123" );'`
And I run `wp network meta get 1 objkey`
Then STDOUT should be:
"""
123
"""
When I run `wp eval 'update_network_option( 1, "objkey", "456" );'`
And I run `wp network meta get 1 objkey`
Then STDOUT should be:
"""
456
"""
When I run `wp network meta update 1 objkey 789`
Then STDOUT should be:
"""
Success: Updated custom field 'objkey'.
"""
When I run `wp network meta get 1 objkey`
Then STDOUT should be:
"""
789
"""
When I run `wp eval 'echo get_network_option( 1, "objkey" );'`
Then STDOUT should be:
"""
789
"""