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
7070 """
7171 And the return code should be 1
7272
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+
7383 Scenario : Get details about an existing comment
7484 When I run `wp comment get 1`
7585 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 ) {
118118 $ assoc_args ,
119119 function ( $ params ) {
120120 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. ' );
122122 }
123123
124124 return true ;
You can’t perform that action at this time.
0 commit comments