Skip to content

Commit 9bd8441

Browse files
committed
adapt feature tests to scheme for older WP versions
1 parent e8a2381 commit 9bd8441

File tree

1 file changed

+40
-35
lines changed

1 file changed

+40
-35
lines changed

features/site-generate.feature

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -59,44 +59,49 @@ Feature: Generate new WordPress sites
5959

6060
Scenario: Generate subdirectory sites
6161
Given a WP multisite subdirectory install
62+
When I run `wp site generate --count=1`
63+
Then STDOUT should be empty
64+
And I run `wp site list --site__in=2 --field=url | sed -e's,^\(.*\)://.*,\1,g'`
65+
And save STDOUT as {SCHEME}
6266

63-
When I run `wp site generate --count=1`
64-
Then STDOUT should be empty
65-
66-
When I run `wp site list --fields=blog_id,url`
67-
Then STDOUT should be a table containing rows:
68-
| blog_id | url |
69-
| 1 | https://example.com/ |
70-
| 2 | https://example.com/site1/ |
71-
When I run `wp site list --format=ids`
72-
Then STDOUT should be:
73-
"""
74-
1 2
75-
"""
67+
When I run `wp site list --fields=blog_id,url`
68+
Then STDOUT should be a table containing rows:
69+
| blog_id | url |
70+
| 1 | https://example.com/ |
71+
| 2 | {SCHEME}://example.com/site1/ |
72+
When I run `wp site list --format=ids`
73+
Then STDOUT should be:
74+
"""
75+
1 2
76+
"""
7677

7778
Scenario: Generate sites with a slug
78-
Given a WP multisite subdirectory install
79-
When I run `wp site generate --count=2 --slug=subsite`
80-
Then STDOUT should be empty
79+
Given a WP multisite subdirectory install
80+
When I run `wp site generate --count=2 --slug=subsite`
81+
Then STDOUT should be empty
82+
And I run `wp site list --site__in=2 --field=url | sed -e's,^\(.*\)://.*,\1,g'`
83+
And save STDOUT as {SCHEME1}
84+
And I run `wp site list --site__in=3 --field=url | sed -e's,^\(.*\)://.*,\1,g'`
85+
And save STDOUT as {SCHEME2}
8186

82-
When I run `wp site list --fields=blog_id,url`
83-
Then STDOUT should be a table containing rows:
84-
| blog_id | url |
85-
| 1 | https://example.com/ |
86-
| 2 | https://example.com/subsite1/ |
87-
| 3 | https://example.com/subsite2/ |
88-
When I run `wp site list --format=ids`
89-
Then STDOUT should be:
90-
"""
91-
1 2 3
92-
"""
87+
When I run `wp site list --fields=blog_id,url`
88+
Then STDOUT should be a table containing rows:
89+
| blog_id | url |
90+
| 1 | https://example.com/ |
91+
| 2 | {SCHEME1}://example.com/subsite1/ |
92+
| 3 | {SCHEME2}://example.com/subsite2/ |
93+
When I run `wp site list --format=ids`
94+
Then STDOUT should be:
95+
"""
96+
1 2 3
97+
"""
9398

9499
Scenario: Generate sites with reserved slug
95-
Given a WP multisite subdirectory install
96-
When I try `wp site generate --count=2 --slug=page`
97-
Then STDERR should contain:
98-
"""
99-
The following words are reserved and cannot be used as blog names: page, comments, blog, files, feed
100-
"""
101-
And STDOUT should be empty
102-
And the return code should be 1
100+
Given a WP multisite subdirectory install
101+
When I try `wp site generate --count=2 --slug=page`
102+
Then STDERR should contain:
103+
"""
104+
The following words are reserved and cannot be used as blog names: page, comments, blog, files, feed
105+
"""
106+
And STDOUT should be empty
107+
And the return code should be 1

0 commit comments

Comments
 (0)