Skip to content

Commit 8a3df5b

Browse files
committed
test: Success/Error returns
1 parent 669caae commit 8a3df5b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

features/comment.feature

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,32 @@ Feature: Manage WordPress comments
604604
Success: Deleted 2 comments.
605605
"""
606606

607+
Scenario: Delete comments with mixed success and failure
608+
Given a WP install
609+
And I run `wp comment create --comment_post_ID=1 --comment_content='Comment 1' --porcelain`
610+
And save STDOUT as {COMMENT_ID_1}
611+
And I run `wp comment create --comment_post_ID=1 --comment_content='Comment 2' --porcelain`
612+
And save STDOUT as {COMMENT_ID_2}
613+
614+
When I run `wp comment delete {COMMENT_ID_1} {COMMENT_ID_2} 99999`
615+
Then STDOUT should contain:
616+
"""
617+
Success: Trashed comment {COMMENT_ID_1}.
618+
"""
619+
And STDOUT should contain:
620+
"""
621+
Success: Trashed comment {COMMENT_ID_2}.
622+
"""
623+
And STDERR should contain:
624+
"""
625+
Warning: Failed deleting comment 99999.
626+
"""
627+
And STDERR should contain:
628+
"""
629+
Error: Failed deleting 1 comments.
630+
"""
631+
And the return code should be 1
632+
607633
Scenario: Error when no comment IDs and no --all flag provided
608634
Given a WP install
609635

0 commit comments

Comments
 (0)