Skip to content

Commit 83e4692

Browse files
authored
Merge pull request #284 from wp-cli/refine-feature-files
Fix Gherkin lint issues
2 parents f114e2f + aa2544e commit 83e4692

File tree

4 files changed

+108
-108
lines changed

4 files changed

+108
-108
lines changed

features/core-download.feature

Lines changed: 61 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ Feature: Download WordPress
3939
When I run `wp core download --force`
4040
Then the wp-settings.php file should exist
4141
And STDOUT should contain:
42-
"""
43-
Using cached file '{SUITE_CACHE_DIR}/core/wordpress-{VERSION}-en_US.tar.gz'...
44-
"""
42+
"""
43+
Using cached file '{SUITE_CACHE_DIR}/core/wordpress-{VERSION}-en_US.tar.gz'...
44+
"""
4545

4646
Scenario: Localized install
4747
Given an empty directory
@@ -115,17 +115,18 @@ Feature: Download WordPress
115115

116116
Scenario: Make sure files are cleaned up
117117
Given an empty directory
118+
118119
When I run `wp core download --version=4.4`
119120
Then the wp-includes/rest-api.php file should exist
120-
Then the wp-includes/class-wp-comment.php file should exist
121+
And the wp-includes/class-wp-comment.php file should exist
121122
And STDERR should not contain:
122123
"""
123124
Warning: Failed to find WordPress version. Please cleanup files manually.
124125
"""
125126

126127
When I run `wp core download --version=4.3.2 --force`
127128
Then the wp-includes/rest-api.php file should not exist
128-
Then the wp-includes/class-wp-comment.php file should not exist
129+
And the wp-includes/class-wp-comment.php file should not exist
129130
And STDOUT should not contain:
130131
"""
131132
File removed: wp-content
@@ -238,9 +239,9 @@ Feature: Download WordPress
238239
When I try `wp core download --version=nightly --locale=de_DE`
239240
Then the return code should be 1
240241
And STDERR should contain:
241-
"""
242-
Error: Nightly builds are only available for the en_US locale.
243-
"""
242+
"""
243+
Error: Nightly builds are only available for the en_US locale.
244+
"""
244245

245246
Scenario: Installing a release candidate or beta version
246247
Given an empty directory
@@ -249,7 +250,7 @@ Feature: Download WordPress
249250
# Test with incorrect case.
250251
When I try `wp core download --version=4.6-rc2`
251252
Then the return code should be 1
252-
Then STDERR should contain:
253+
And STDERR should contain:
253254
"""
254255
Error: Release not found.
255256
"""
@@ -281,62 +282,62 @@ Feature: Download WordPress
281282
Scenario: Fail if path can't be created
282283
Given an empty directory
283284
And a non-directory-path file:
284-
"""
285-
"""
285+
"""
286+
"""
286287

287288
When I try `wp core download --path=non-directory-path`
288289
Then STDERR should contain:
289-
"""
290-
Failed to create directory
291-
"""
290+
"""
291+
Failed to create directory
292+
"""
292293
And STDERR should contain:
293-
"""
294-
/non-directory-path/
295-
"""
294+
"""
295+
/non-directory-path/
296+
"""
296297
And the return code should be 1
297298

298299
When I try `WP_CLI_STRICT_ARGS_MODE=1 wp core download --path=non-directory-path`
299300
Then STDERR should contain:
300-
"""
301-
Failed to create directory
302-
"""
301+
"""
302+
Failed to create directory
303+
"""
303304
And STDERR should contain:
304-
"""
305-
non-directory-path/
306-
"""
305+
"""
306+
non-directory-path/
307+
"""
307308
And the return code should be 1
308309

309310
When I try `WP_CLI_STRICT_ARGS_MODE=1 wp core download --path=non-directory-path\\`
310311
Then STDERR should contain:
311-
"""
312-
Failed to create directory
313-
"""
312+
"""
313+
Failed to create directory
314+
"""
314315
And STDERR should contain:
315-
"""
316-
non-directory-path/
317-
"""
316+
"""
317+
non-directory-path/
318+
"""
318319
And the return code should be 1
319320

320321
When I try `wp core download --path=/root-level-directory`
321322
Then STDERR should contain:
322-
"""
323-
Insufficient permission to create directory
324-
"""
323+
"""
324+
Insufficient permission to create directory
325+
"""
325326
And STDERR should contain:
326-
"""
327-
/root-level-directory/
328-
"""
327+
"""
328+
/root-level-directory/
329+
"""
329330
And the return code should be 1
330331

331332
When I try `WP_CLI_STRICT_ARGS_MODE=1 wp core download --path=/root-level-directory`
332333
Then STDERR should contain:
333-
"""
334-
Insufficient permission to create directory
335-
"""
334+
"""
335+
Insufficient permission to create directory
336+
"""
336337
And STDERR should contain:
337-
"""
338-
/root-level-directory/
339-
"""
338+
"""
339+
/root-level-directory/
340+
"""
340341
And the return code should be 1
341342

342343
Scenario: Core download without the full wp-content/plugins dir
@@ -366,9 +367,9 @@ Feature: Download WordPress
366367
And the wp-includes directory should exist
367368
And the wp-content/themes directory should exist
368369
And the wp-content/themes directory should be:
369-
"""
370-
index.php
371-
"""
370+
"""
371+
index.php
372+
"""
372373
And the wp-includes/js/tinymce/themes directory should exist
373374

374375
Scenario: Core download without the full wp-content/plugins dir should work non US locale
@@ -382,9 +383,9 @@ Feature: Download WordPress
382383
And the wp-includes directory should exist
383384
And the wp-content/plugins directory should exist
384385
And the wp-content/plugins directory should be:
385-
"""
386-
index.php
387-
"""
386+
"""
387+
index.php
388+
"""
388389
And the wp-includes/js/tinymce/plugins directory should exist
389390

390391
Scenario: Core download without the full wp-content/themes dir should work non US locale
@@ -398,9 +399,9 @@ Feature: Download WordPress
398399
And the wp-includes directory should exist
399400
And the wp-content/themes directory should exist
400401
And the wp-content/themes directory should be:
401-
"""
402-
index.php
403-
"""
402+
"""
403+
index.php
404+
"""
404405
And the wp-includes/js/tinymce/themes directory should exist
405406

406407
Scenario: Core download without the full wp-content/plugins dir should work if a version is set
@@ -414,14 +415,14 @@ Feature: Download WordPress
414415
And the wp-includes directory should exist
415416
And the wp-content/plugins directory should exist
416417
And the wp-content/plugins directory should be:
417-
"""
418-
index.php
419-
"""
418+
"""
419+
index.php
420+
"""
420421
And the wp-content/themes directory should exist
421422
And the wp-content/themes directory should be:
422-
"""
423-
index.php
424-
"""
423+
"""
424+
index.php
425+
"""
425426
And the wp-includes/js/tinymce/themes directory should exist
426427
And the wp-includes/js/tinymce/plugins directory should exist
427428

@@ -474,12 +475,12 @@ Feature: Download WordPress
474475
"""
475476
And the return code should be 1
476477

477-
Scenario: Allow installing major version with trailing zero
478+
Scenario: Allow installing major version with trailing zero
478479
Given an empty directory
479480

480481
When I run `wp core download --version=6.7.0`
481482
Then STDOUT should contain:
482-
"""
483-
Success:
484-
"""
483+
"""
484+
Success:
485+
"""
485486

features/core-install.feature

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,17 @@ Feature: Install WordPress core
195195
196196
When I run `wp config create --dbname={DB_NAME} --dbuser={DB_USER} --dbpass={DB_PASSWORD} --dbhost={DB_HOST} --locale=de_DE --skip-check`
197197
Then STDOUT should be:
198-
"""
199-
Success: Generated 'wp-config.php' file.
200-
"""
198+
"""
199+
Success: Generated 'wp-config.php' file.
200+
"""
201201
202202
# Old versions of WP can generate wpdb database errors if the WP tables don't exist, so STDERR may or may not be empty
203203
When I try `wp core install --url=example.org --title=Test --admin_user=testadmin --admin_email=testadmin@example.com --admin_password=newpassword --locale=de_DE --skip-email`
204204
Then STDERR should contain:
205205
"""
206206
Warning: The flag --locale=de_DE is being ignored as it requires WordPress 4.0+.
207207
"""
208-
Then STDOUT should contain:
208+
And STDOUT should contain:
209209
"""
210210
Success: WordPress installed successfully.
211211
"""
@@ -241,9 +241,9 @@ Feature: Install WordPress core
241241

242242
When I run `wp config create --dbname={DB_NAME} --dbuser={DB_USER} --dbpass={DB_PASSWORD} --dbhost={DB_HOST} --locale=de_DE --skip-check`
243243
Then STDOUT should be:
244-
"""
245-
Success: Generated 'wp-config.php' file.
246-
"""
244+
"""
245+
Success: Generated 'wp-config.php' file.
246+
"""
247247

248248
# Old versions of WP can generate wpdb database errors if the WP tables don't exist, so STDERR may or may not be empty
249249
When I run `wp core install --url=example.org --title=Test --admin_user=testadmin --admin_email=testadmin@example.com --admin_password=newpassword --locale=de_DE --skip-email`
@@ -290,9 +290,9 @@ Feature: Install WordPress core
290290

291291
When I run `wp core multisite-install --url=foobar.org --title=Test --admin_user=wpcli --admin_email=admin@example.com --admin_password=password --skip-config`
292292
Then STDOUT should contain:
293-
"""
294-
Addition of multisite constants to 'wp-config.php' skipped. You need to add them manually:
295-
"""
293+
"""
294+
Addition of multisite constants to 'wp-config.php' skipped. You need to add them manually:
295+
"""
296296

297297
@require-mysql
298298
Scenario: Install WordPress multisite with existing multisite constants in wp-config file

features/core-update.feature

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -228,18 +228,19 @@ Feature: Update WordPress core
228228
Scenario: Make sure files are cleaned up
229229
Given a WP install
230230
And I try `wp theme install twentytwenty --activate`
231+
231232
When I run `wp core update --version=4.4 --force`
232233
Then the wp-includes/rest-api.php file should exist
233-
Then the wp-includes/class-wp-comment.php file should exist
234+
And the wp-includes/class-wp-comment.php file should exist
234235
And STDOUT should not contain:
235236
"""
236237
File removed: wp-content
237238
"""
238239

239240
When I run `wp core update --version=4.3.2 --force`
240241
Then the wp-includes/rest-api.php file should not exist
241-
Then the wp-includes/class-wp-comment.php file should not exist
242-
Then STDOUT should contain:
242+
And the wp-includes/class-wp-comment.php file should not exist
243+
And STDOUT should contain:
243244
"""
244245
File removed: wp-includes/class-walker-comment.php
245246
File removed: wp-includes/class-wp-network.php
@@ -267,13 +268,13 @@ Feature: Update WordPress core
267268

268269
When I run `wp core update --version=5.8 --force`
269270
Then the wp-includes/Requests/Transport/cURL.php file should exist
270-
Then the wp-includes/Requests/Exception/Transport/cURL.php file should exist
271-
Then the wp-includes/Requests/Exception/HTTP/502.php file should exist
272-
Then the wp-includes/Requests/IRI.php file should exist
273-
Then the wp-includes/Requests/src/Transport/Curl.php file should not exist
274-
Then the wp-includes/Requests/src/Exception/Transport/Curl.php file should not exist
275-
Then the wp-includes/Requests/src/Exception/Http/Status502.php file should not exist
276-
Then the wp-includes/Requests/src/Iri.php file should not exist
271+
And the wp-includes/Requests/Exception/Transport/cURL.php file should exist
272+
And the wp-includes/Requests/Exception/HTTP/502.php file should exist
273+
And the wp-includes/Requests/IRI.php file should exist
274+
And the wp-includes/Requests/src/Transport/Curl.php file should not exist
275+
And the wp-includes/Requests/src/Exception/Transport/Curl.php file should not exist
276+
And the wp-includes/Requests/src/Exception/Http/Status502.php file should not exist
277+
And the wp-includes/Requests/src/Iri.php file should not exist
277278
And STDOUT should contain:
278279
"""
279280
Cleaning up files...
@@ -285,13 +286,13 @@ Feature: Update WordPress core
285286

286287
When I run `wp core update --version=6.2 --force`
287288
Then the wp-includes/Requests/Transport/cURL.php file should not exist
288-
Then the wp-includes/Requests/Exception/Transport/cURL.php file should not exist
289-
Then the wp-includes/Requests/Exception/HTTP/502.php file should not exist
290-
Then the wp-includes/Requests/IRI.php file should not exist
291-
Then the wp-includes/Requests/src/Transport/Curl.php file should exist
292-
Then the wp-includes/Requests/src/Exception/Transport/Curl.php file should exist
293-
Then the wp-includes/Requests/src/Exception/Http/Status502.php file should exist
294-
Then the wp-includes/Requests/src/Iri.php file should exist
289+
And the wp-includes/Requests/Exception/Transport/cURL.php file should not exist
290+
And the wp-includes/Requests/Exception/HTTP/502.php file should not exist
291+
And the wp-includes/Requests/IRI.php file should not exist
292+
And the wp-includes/Requests/src/Transport/Curl.php file should exist
293+
And the wp-includes/Requests/src/Exception/Transport/Curl.php file should exist
294+
And the wp-includes/Requests/src/Exception/Http/Status502.php file should exist
295+
And the wp-includes/Requests/src/Iri.php file should exist
295296
And STDOUT should contain:
296297
"""
297298
Cleaning up files...
@@ -318,9 +319,9 @@ Feature: Update WordPress core
318319
"""
319320

320321
Examples:
321-
| version |
322-
| trunk |
323-
| nightly |
322+
| version |
323+
| trunk |
324+
| nightly |
324325

325326
@require-php-7.2
326327
Scenario: Installing latest nightly build should skip cache
@@ -353,8 +354,6 @@ Feature: Update WordPress core
353354

354355
When I run `wp core update --version=6.2.0 --force`
355356
Then STDOUT should contain:
356-
"""
357-
Success:
358-
"""
359-
360-
357+
"""
358+
Success:
359+
"""

0 commit comments

Comments
 (0)