From d7235c82454fa257d2cc16622175be43af594a7b Mon Sep 17 00:00:00 2001 From: Deepak Kumar Date: Fri, 26 Apr 2024 19:21:23 +0530 Subject: [PATCH] Add more tests --- features/site-generate.feature | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/features/site-generate.feature b/features/site-generate.feature index 4fef761e..3941f168 100644 --- a/features/site-generate.feature +++ b/features/site-generate.feature @@ -24,7 +24,7 @@ Feature: Generate new WordPress sites When I try `wp site generate --count=4 --network_id=2` Then STDERR should contain: """ - Network with id 2 does not exist. + Network with id 2 does not exist. """ And STDOUT should be empty And the return code should be 1 @@ -72,4 +72,31 @@ Feature: Generate new WordPress sites Then STDOUT should be: """ 1 2 - """ \ No newline at end of file + """ + + Scenario: Generate sites with a slug + Given a WP multisite subdirectory install + When I run `wp site generate --count=2 --slug=subsite` + Then STDOUT should be empty + + When I run `wp site list --fields=blog_id,url` + Then STDOUT should be a table containing rows: + | blog_id | url | + | 1 | https://example.com/ | + | 2 | https://example.com/subsite1/ | + | 3 | https://example.com/subsite2/ | + When I run `wp site list --format=ids` + Then STDOUT should be: + """ + 1 2 3 + """ + + Scenario: Generate sites with reserved slug + Given a WP multisite subdirectory install + When I try `wp site generate --count=2 --slug=page` + Then STDERR should contain: + """ + The following words are reserved and cannot be used as blog names: page, comments, blog, files, feed + """ + And STDOUT should be empty + And the return code should be 1