Skip to content

Commit ac40535

Browse files
Copilotswissspidy
andcommitted
Fix code review issues in behat-steps tests
Co-authored-by: swissspidy <[email protected]>
1 parent 975dde4 commit ac40535

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

features/behat-steps.feature

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ Feature: Test that WP-CLI Behat steps work as expected
325325
@require-wp
326326
Scenario: Test STDOUT as table containing rows
327327
Given a WP installation
328-
When I run `wp option list --fields=option_name --format=table --orderby=option_name | head -5`
328+
When I run `wp option list --fields=option_name --format=table --orderby=option_name`
329329
Then STDOUT should be a table containing rows:
330330
| option_name |
331331

@@ -335,7 +335,7 @@ Feature: Test that WP-CLI Behat steps work as expected
335335
When I run `wp option get siteurl --format=json`
336336
Then STDOUT should be JSON containing:
337337
"""
338-
"http
338+
"example.com"
339339
"""
340340

341341
@require-wp
@@ -350,8 +350,11 @@ Feature: Test that WP-CLI Behat steps work as expected
350350
@require-wp
351351
Scenario: Test YAML output
352352
Given a WP installation
353-
When I run `wp eval "echo 'test: value';" | wp --skip-wordpress cli info --format=yaml | head -1`
354-
Then STDOUT should not be empty
353+
When I run `wp cli info --format=yaml`
354+
Then STDOUT should be YAML containing:
355+
"""
356+
PHP binary:
357+
"""
355358

356359
@require-wp
357360
Scenario: Test save file as variable
@@ -419,11 +422,12 @@ Feature: Test that WP-CLI Behat steps work as expected
419422
define( 'WP_CONTENT_DIR', '' );
420423
"""
421424

425+
@require-download
422426
Scenario: Test download step
423427
Given an empty cache
424428
And download:
425-
| path | url |
426-
| {SUITE_CACHE_DIR}/test.txt | https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml |
429+
| path | url |
430+
| {SUITE_CACHE_DIR}/test.txt | https://www.iana.org/robots.txt |
427431
Then the {SUITE_CACHE_DIR}/test.txt file should exist
428432

429433
@require-wp @require-composer
@@ -632,7 +636,7 @@ Feature: Test that WP-CLI Behat steps work as expected
632636
Scenario: Test variable naming conventions
633637
When I run `echo "value1"`
634638
Then save STDOUT as {VAR_NAME}
635-
639+
636640
When I run `echo {VAR_NAME}`
637641
Then STDOUT should be:
638642
"""
@@ -642,7 +646,7 @@ Feature: Test that WP-CLI Behat steps work as expected
642646
Scenario: Test variable with underscore prefix
643647
When I run `echo "value2"`
644648
Then save STDOUT as {_UNDERSCORE_VAR}
645-
649+
646650
When I run `echo {_UNDERSCORE_VAR}`
647651
Then STDOUT should contain:
648652
"""
@@ -652,7 +656,7 @@ Feature: Test that WP-CLI Behat steps work as expected
652656
Scenario: Test variable with numbers
653657
When I run `echo "value3"`
654658
Then save STDOUT as {VAR123}
655-
659+
656660
When I run `echo {VAR123}`
657661
Then STDOUT should contain:
658662
"""

0 commit comments

Comments
 (0)