Skip to content

Commit

Permalink
Issue wp-cli#356 : Improve behat test for new command
Browse files Browse the repository at this point in the history
  • Loading branch information
buntybuddyboss committed Aug 29, 2022
1 parent c936353 commit 237ff0a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 15 additions & 2 deletions features/post-meta.feature
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,19 @@ Feature: Manage post custom fields
Success: Added custom field.
"""
When I try the previous command again
When I run the previous command again
Then the return code should be 0
When I try the previous command again
When I run the previous command again
Then the return code should be 0
When I run `wp post meta list 1 --keys=foo`
Then STDOUT should be a table containing rows:
| post_id | meta_key | meta_value |
| 1 | foo | bar |
| 1 | foo | bar |
| 1 | foo | bar |
When I run `wp post meta clean-duplicates 1 foo < session_no`
# Check for contains only, as the string contains a trailing space.
Then STDOUT should contain:
Expand All @@ -525,6 +532,12 @@ Feature: Manage post custom fields
Success: Cleaned up duplicate enclosures.
"""
When I try the previous command again
Then STDOUT should contain:
"""
Success: Nothing to clean up: found 1 valid enclosures and 0 duplicate enclosures.
"""
When I try `wp post meta clean-duplicates 1 food`
Then STDERR should be:
"""
Expand Down
2 changes: 2 additions & 0 deletions src/Post_Meta_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ protected function delete_metadata( $object_id, $meta_key, $meta_value = '' ) {
*
* ## EXAMPLES
*
* # Delete dulpicate post meta.
* wp post meta clean-duplicates 1234 enclosure
* Success: Cleaned up duplicate enclosures.
*
* @subcommand clean-duplicates
*/
Expand Down

0 comments on commit 237ff0a

Please sign in to comment.