mirror of
https://ghproxy.net/https://github.com/wp-cli/entity-command.git
synced 2026-07-27 13:08:43 +08:00
* Initial plan * Document that --network excludes roles field in wp user list Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
57 lines
1.5 KiB
Gherkin
57 lines
1.5 KiB
Gherkin
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
|
|
"""
|