File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,16 @@ Feature: Manage WordPress comments
70
70
"""
71
71
And the return code should be 1
72
72
73
+ Scenario : Updating an invalid comment should return an error
74
+ Given a WP install
75
+
76
+ When I try `wp comment update 22 --comment_author=Foo`
77
+ Then the return code should be 1
78
+ And STDERR should contain:
79
+ """
80
+ Warning: Could not update comment.
81
+ """
82
+
73
83
Scenario : Get details about an existing comment
74
84
When I run `wp comment get 1`
75
85
Then STDOUT should be a table containing rows:
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ public function update( $args, $assoc_args ) {
118
118
$ assoc_args ,
119
119
function ( $ params ) {
120
120
if ( ! wp_update_comment ( $ params ) ) {
121
- return new WP_Error ( 'Could not update comment. ' );
121
+ return new WP_Error ( 'db_error ' , ' Could not update comment. ' );
122
122
}
123
123
124
124
return true ;
You can’t perform that action at this time.
0 commit comments