-
·
Then /^the return code should( not)? be (d+)$/
Expect a specific exit code of the previous command. Usage Scenario: My example scenario Given a WP installation When I try `wp plugin install` Then the return code should be 1 Behat steps documentation is generated from the WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in…
-
·
When /^I launch in the background `([^`]+)`$/
Launch a given command in the background. Usage Scenario: My example scenario Given a WP install And I launch in the background `wp server –host=localhost –port=8181` … Behat steps documentation is generated from the WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The…
-
·
When /^I (run|try) `([^`]+)` from ‘([^s]+)’$/
Run or try a given command in a subdirectory. Usage run expects an exit code 0, whereas try allows for non-zero exit codes. Scenario: My example scenario When I run `wp core is-installed` Then STDOUT should be empty When I run `wp core is-installed` from ‘foo/wp-content’ Then STDOUT should be empty Behat steps documentation is…
-
·
When /^I (run|try) the previous command again$/
Run or try the previous command again. Usage run expects an exit code 0, whereas try allows for non-zero exit codes. Scenario: My example scenario When I run `wp site option update admin_user_id 1` Then STDOUT should contain: “”” Success: Updated ‘admin_user_id’ site option. “”” When I run the previous command again Then STDOUT should…
-
·
When /^I (run|try) `([^`]+)`$/
Run or try a given command. Usage run expects an exit code 0, whereas try allows for non-zero exit codes. So if using run and the command errors, the step will fail. Scenario: My example scenario When I run `wp core version` Then STDOUT should contain: “”” 6.8 “”” Scenario: My other scenario When I…
-
·
Then /^(STDOUT|STDERR) should not be a number$/
Expect STDOUT or STDERR to not be a numeric value. Usage Scenario: My example scenario Given a WP installation When I run `wp post list –format=json` Then STDOUT should not be a number Behat steps documentation is generated from the WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development…
-
·
Then /^(STDOUT|STDERR) should not be empty$/
Expect STDOUT or STDERR not to be empty. Usage Scenario: My example scenario When I run `wp user create examplejane [email protected]` Then STDOUT should not be empty Behat steps documentation is generated from the WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The…
-
·
Then /^(STDOUT|STDERR) should( not)? match (((/.+/)|(#.+#))([a-z]+)?)$/
Match STDOUT or STDERR against a regex. Usage Scenario: My example scenario When I run `wp dist-archive wp-content/plugins/hello-world` Then STDOUT should match /^Success: Created hello-world.0.1.0.zip \(Size: \d+(?:\.\d*)? [a-zA-Z]{1,3}\)$/ Behat steps documentation is generated from the WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way.…
-
·
Then /^STDOUT should be a JSON array containing:$/
Expect valid JSONJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. array output in STDOUT. Usage Errors when some items are missing from the expected array. Scenario: My example scenario When I…
-
·
Then /^(STDOUT|STDERR) should( strictly)? (be|contain|not contain):$/
Check the contents of STDOUT or STDERR. Usage Scenario: My example scenario Given an empty directory When I run `wp core is-installed` Then STDOUT should be empty Scenario: My other scenario Given a WP install When I run `wp plugin install akismet` Then STDOUT should contain: “”” Plugin installed successfully. “”” And STDERR should be…