@@ -8,6 +8,8 @@ Feature: Manage sites in a multisite installation
88 """
99 Network with id 1000 does not exist.
1010 """
11+ And STDOUT should be empty
12+ And the return code should be 1
1113
1214 Scenario : Create a subdomain site
1315 Given a WP multisite subdomain install
@@ -61,6 +63,7 @@ Feature: Manage sites in a multisite installation
6163 """
6264 Error: You cannot delete the root site.
6365 """
66+ And STDOUT should be empty
6467 And the return code should be 1
6568
6669 When I run `wp site delete {SITE_ID} --yes`
@@ -151,7 +154,7 @@ Feature: Manage sites in a multisite installation
151154 | blog_id | archived |
152155 | {FIRST_SITE } | 1 |
153156
154- When I run `wp site archive {FIRST_SITE} {SECOND_SITE}`
157+ When I try `wp site archive {FIRST_SITE} {SECOND_SITE}`
155158 Then STDERR should be:
156159 """
157160 Warning: Site {FIRST_SITE} already archived.
@@ -160,6 +163,7 @@ Feature: Manage sites in a multisite installation
160163 """
161164 Success: Site {SECOND_SITE} archived.
162165 """
166+ And the return code should be 0
163167
164168 When I run `wp site list --fields=blog_id,archived`
165169 Then STDOUT should be a table containing rows:
@@ -172,7 +176,7 @@ Feature: Manage sites in a multisite installation
172176 Success: Site {FIRST_SITE} unarchived.
173177 """
174178
175- When I run `wp site list --fields=blog_id,archived`
179+ When I try `wp site list --fields=blog_id,archived`
176180 Then STDOUT should be a table containing rows:
177181 | blog_id | archived |
178182 | {FIRST_SITE } | 0 |
@@ -182,6 +186,8 @@ Feature: Manage sites in a multisite installation
182186 """
183187 Warning: You are not allowed to change the main site.
184188 """
189+ And STDOUT should be empty
190+ And the return code should be 0
185191
186192 Scenario : Activate/deactivate a site
187193 Given a WP multisite install
@@ -201,7 +207,7 @@ Feature: Manage sites in a multisite installation
201207 | blog_id | deleted |
202208 | {FIRST_SITE } | 1 |
203209
204- When I run `wp site deactivate {FIRST_SITE} {SECOND_SITE}`
210+ When I try `wp site deactivate {FIRST_SITE} {SECOND_SITE}`
205211 Then STDERR should be:
206212 """
207213 Warning: Site {FIRST_SITE} already deactivated.
@@ -210,6 +216,7 @@ Feature: Manage sites in a multisite installation
210216 """
211217 Success: Site {SECOND_SITE} deactivated.
212218 """
219+ And the return code should be 0
213220
214221 When I run `wp site list --fields=blog_id,deleted`
215222 Then STDOUT should be a table containing rows:
@@ -227,11 +234,13 @@ Feature: Manage sites in a multisite installation
227234 | blog_id | deleted |
228235 | {FIRST_SITE } | 0 |
229236
230- When I run `wp site deactivate 1`
237+ When I try `wp site deactivate 1`
231238 Then STDERR should be:
232239 """
233240 Warning: You are not allowed to change the main site.
234241 """
242+ And STDOUT should be empty
243+ And the return code should be 0
235244
236245 Scenario : Mark/remove a site from spam
237246 Given a WP multisite install
@@ -251,7 +260,7 @@ Feature: Manage sites in a multisite installation
251260 | blog_id | spam |
252261 | {FIRST_SITE } | 1 |
253262
254- When I run `wp site spam {FIRST_SITE} {SECOND_SITE}`
263+ When I try `wp site spam {FIRST_SITE} {SECOND_SITE}`
255264 Then STDERR should be:
256265 """
257266 Warning: Site {FIRST_SITE} already marked as spam.
@@ -260,6 +269,7 @@ Feature: Manage sites in a multisite installation
260269 """
261270 Success: Site {SECOND_SITE} marked as spam.
262271 """
272+ And the return code should be 0
263273
264274 When I run `wp site list --fields=blog_id,spam`
265275 Then STDOUT should be a table containing rows:
@@ -277,11 +287,13 @@ Feature: Manage sites in a multisite installation
277287 | blog_id | spam |
278288 | {FIRST_SITE } | 0 |
279289
280- When I run `wp site spam 1`
290+ When I try `wp site spam 1`
281291 Then STDERR should be:
282292 """
283293 Warning: You are not allowed to change the main site.
284294 """
295+ And STDOUT should be empty
296+ And the return code should be 0
285297
286298 Scenario : Mark/remove a site as mature
287299 Given a WP multisite install
@@ -301,7 +313,7 @@ Feature: Manage sites in a multisite installation
301313 | blog_id | mature |
302314 | {FIRST_SITE } | 1 |
303315
304- When I run `wp site mature {FIRST_SITE} {SECOND_SITE}`
316+ When I try `wp site mature {FIRST_SITE} {SECOND_SITE}`
305317 Then STDERR should be:
306318 """
307319 Warning: Site {FIRST_SITE} already marked as mature.
@@ -310,6 +322,7 @@ Feature: Manage sites in a multisite installation
310322 """
311323 Success: Site {SECOND_SITE} marked as mature.
312324 """
325+ And the return code should be 0
313326
314327 When I run `wp site list --fields=blog_id,mature`
315328 Then STDOUT should be a table containing rows:
@@ -327,11 +340,13 @@ Feature: Manage sites in a multisite installation
327340 | blog_id | mature |
328341 | {FIRST_SITE } | 0 |
329342
330- When I run `wp site unmature 1`
343+ When I try `wp site unmature 1`
331344 Then STDERR should be:
332345 """
333346 Warning: You are not allowed to change the main site.
334347 """
348+ And STDOUT should be empty
349+ And the return code should be 0
335350
336351 Scenario : Set/Unset a site as public
337352 Given a WP multisite install
@@ -351,7 +366,7 @@ Feature: Manage sites in a multisite installation
351366 | blog_id | public |
352367 | {FIRST_SITE } | 0 |
353368
354- When I run `wp site private {FIRST_SITE} {SECOND_SITE}`
369+ When I try `wp site private {FIRST_SITE} {SECOND_SITE}`
355370 Then STDERR should be:
356371 """
357372 Warning: Site {FIRST_SITE} already marked as private.
@@ -360,6 +375,7 @@ Feature: Manage sites in a multisite installation
360375 """
361376 Success: Site {SECOND_SITE} marked as private.
362377 """
378+ And the return code should be 0
363379
364380 When I run `wp site list --fields=blog_id,public`
365381 Then STDOUT should be a table containing rows:
@@ -377,11 +393,13 @@ Feature: Manage sites in a multisite installation
377393 | blog_id | public |
378394 | {FIRST_SITE } | 1 |
379395
380- When I run `wp site private 1`
396+ When I try `wp site private 1`
381397 Then STDERR should be:
382398 """
383399 Warning: You are not allowed to change the main site.
384400 """
401+ And STDOUT should be empty
402+ And the return code should be 0
385403
386404 Scenario : Permit CLI operations against archived and suspended sites
387405 Given a WP multisite install
0 commit comments