@@ -46,6 +46,7 @@ Feature: Manage WordPress comments
4646 """
4747 Error: Invalid comment ID.
4848 """
49+ And the return code should be 1
4950
5051 When I run `wp comment create --comment_post_ID=1`
5152 And I run `wp comment create --comment_post_ID=1`
@@ -67,6 +68,7 @@ Feature: Manage WordPress comments
6768 """
6869 Error: Invalid comment ID.
6970 """
71+ And the return code should be 1
7072
7173 Scenario : Get details about an existing comment
7274 When I run `wp comment get 1`
@@ -154,7 +156,7 @@ Feature: Manage WordPress comments
154156 Given I run `wp comment create --comment_post_ID=1 --comment_approved=0 --porcelain`
155157 And save STDOUT as {COMMENT_ID}
156158
157- When I run `wp comment approve {COMMENT_ID}`
159+ When I run `wp comment approve {COMMENT_ID} --url=www.example.com `
158160 Then STDOUT should contain:
159161 """
160162 Approved comment {COMMENT_ID}
@@ -166,7 +168,7 @@ Feature: Manage WordPress comments
166168 1
167169 """
168170
169- When I run `wp comment unapprove {COMMENT_ID}`
171+ When I run `wp comment unapprove {COMMENT_ID} --url=www.example.com `
170172 Then STDOUT should contain:
171173 """
172174 Unapproved comment {COMMENT_ID}
@@ -178,13 +180,47 @@ Feature: Manage WordPress comments
178180 0
179181 """
180182
183+ When I try `wp comment approve {COMMENT_ID}`
184+ Then STDOUT should contain:
185+ """
186+ Approved comment {COMMENT_ID}
187+ """
188+ And STDERR should contain:
189+ """
190+ Warning: `$_SERVER['SERVER_NAME']` not set. Setting to 'example.com'. Notification email sent to post author may appear to come from 'example.com'.
191+ """
192+ And the return code should be 0
193+
194+ When I run `wp comment get --field=comment_approved {COMMENT_ID}`
195+ Then STDOUT should be:
196+ """
197+ 1
198+ """
199+
200+ When I try `wp comment unapprove {COMMENT_ID}`
201+ Then STDOUT should contain:
202+ """
203+ Unapproved comment {COMMENT_ID}
204+ """
205+ And STDERR should contain:
206+ """
207+ Warning: `$_SERVER['SERVER_NAME']` not set. Setting to 'example.com'. Notification email sent to post author may appear to come from 'example.com'.
208+ """
209+ And the return code should be 0
210+
211+ When I run `wp comment get --field=comment_approved {COMMENT_ID}`
212+ Then STDOUT should be:
213+ """
214+ 0
215+ """
216+
181217 Scenario : Approving/unapproving comments with multidigit comment ID
182218 Given I run `wp comment delete $(wp comment list --field=ID)`
183219 And I run `wp comment generate --count=10 --quiet`
184220 And I run `wp comment create --porcelain`
185221 And save STDOUT as {COMMENT_ID}
186222
187- When I run `wp comment unapprove {COMMENT_ID}`
223+ When I run `wp comment unapprove {COMMENT_ID} --url=www.example.com `
188224 Then STDOUT should contain:
189225 """
190226 Unapproved comment {COMMENT_ID}
@@ -196,7 +232,7 @@ Feature: Manage WordPress comments
196232 10
197233 """
198234
199- When I run `wp comment approve {COMMENT_ID}`
235+ When I run `wp comment approve {COMMENT_ID} --url=www.example.com `
200236 Then STDOUT should contain:
201237 """
202238 Approved comment {COMMENT_ID}
0 commit comments