Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2622 from wp-cli/2224-generate-format-ids
Use `--format=ids` with `wp (*) generate` output generated ids
- Loading branch information
Showing
10 changed files
with
192 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Feature: Generate WP terms | ||
|
||
Background: | ||
Given a WP install | ||
|
||
Scenario: Generating terms | ||
When I run `wp term generate category --count=10` | ||
And I run `wp term list category --format=count` | ||
Then STDOUT should be: | ||
""" | ||
11 | ||
""" | ||
|
||
Scenario: Generating terms when terms already exist | ||
When I run `wp term generate category --count=10` | ||
And I run `wp term generate category --count=10` | ||
And I run `wp term list category --format=count` | ||
Then STDOUT should be: | ||
""" | ||
21 | ||
""" | ||
|
||
Scenario: Generating terms and outputting ids | ||
When I run `wp term generate category --count=1 --format=ids` | ||
Then save STDOUT as {TERM_ID} | ||
|
||
When I run `wp term update category {TERM_ID} --name="foo"` | ||
Then STDOUT should contain: | ||
""" | ||
Success: | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Feature: Generate WP users | ||
|
||
Background: | ||
Given a WP install | ||
|
||
Scenario: Generating and deleting users | ||
When I run `wp user list --role=editor --format=count` | ||
Then STDOUT should be: | ||
""" | ||
0 | ||
""" | ||
|
||
When I run `wp user generate --count=10 --role=editor` | ||
And I run `wp user list --role=editor --format=count` | ||
Then STDOUT should be: | ||
""" | ||
10 | ||
""" | ||
|
||
When I try `wp user list --field=ID | xargs wp user delete invalid-user --yes` | ||
And I run `wp user list --format=count` | ||
Then STDOUT should be: | ||
""" | ||
0 | ||
""" | ||
|
||
Scenario: Generating users and outputting ids | ||
When I run `wp user generate --count=1 --format=ids` | ||
Then save STDOUT as {USER_ID} | ||
|
||
When I run `wp user update {USER_ID} --display_name="foo"` | ||
Then STDOUT should contain: | ||
""" | ||
Success: | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters