-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathuser-list.feature
More file actions
57 lines (48 loc) · 1.47 KB
/
user-list.feature
File metadata and controls
57 lines (48 loc) · 1.47 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
Feature: List WordPress users
@require-wp-4.4
Scenario: List users of specific roles
Given a WP install
And I run `wp user create bobjones bob@example.com --role=author`
And I run `wp user create sally sally@example.com --role=editor`
When I run `wp user list --field=user_login`
Then STDOUT should be:
"""
admin
bobjones
sally
"""
When I run `wp user list --role__in=administrator,editor --field=user_login`
Then STDOUT should be:
"""
admin
sally
"""
When I run `wp user list --role__not_in=administrator,editor --field=user_login`
Then STDOUT should be:
"""
bobjones
"""
Scenario: List network users excludes roles field
Given a WP multisite install
And I run `wp user create bobjones bob@example.com --role=author`
When I run `wp user list --network --format=csv`
Then STDOUT should contain:
"""
ID,user_login,display_name,user_email,user_registered
"""
And STDOUT should not contain:
"""
roles
"""
@require-wp-4.9
Scenario: List users without roles
Given a WP install
When I run `wp user create bili bili@example.com --porcelain`
Then save STDOUT as {USER_ID}
And I run `wp user create sally sally@example.com --role=editor`
And I run `wp user remove-role {USER_ID} subscriber`
When I run `wp user list --role=none --field=user_login`
Then STDOUT should be:
"""
bili
"""