-
·
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-CLI codebase on every release. To suggest improvements, please submit a pull request. Related Then…
-
·
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-CLI codebase on every release. To suggest improvements, please submit a pull request. Related Then /^the return code should( not)? be…
-
·
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-CLI codebase on every release. To suggest improvements, please submit a pull request. Related Then /^the return code should( not)?…
-
·
Then /^STDOUT should be a JSON array containing:$/
Expect valid JSON array output in STDOUT. Usage Errors when some items are missing from the expected array. Scenario: My example scenario When I run `wp plugin list –field=name –format=json` Then STDOUT should be a JSON array containing: “”” [“akismet”, “hello-dolly”] “”” Behat steps documentation is generated from the WP-CLI codebase on every release. To…
-
·
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…
-
·
Then /^STDOUT should be a table containing rows:$/
Expect STDOUT to be a table containing the given rows. Usage Scenario: My example scenario Given a WP installation When I run `wp config list –fields=name,type` Then STDOUT should be a table containing rows: | name | type | | DB_NAME | constant | | DB_USER | constant | Behat steps documentation is generated from…
-
·
Then /^the contents of the (.+) file should( not)? match (((/.+/)|(#.+#))([a-z]+)?)$/
Match file contents against a regex. Usage Scenario: My example scenario When I run `wp scaffold plugin hello-world` Then the contents of the wp-content/plugins/hello-world/languages/hello-world.pot file should match /X-Generator:\s/ Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request. Related Then /^the return code should( not)?…
-
·
Then /^the (.+) (file|directory) should( strictly)? (exist|not exist|be:|contain:|not contain:)$/
Expect a certain file or directory to (not) exist or (not) contain certain contents. Usage Scenario: My example scenario When I run `wp core download` Then the wp-settings.php file should exist And the wp-content directory should exist And the {RUN_DIR} directory should contain: “”” index.php license.txt “”” And the wp-config.php file should contain: “”” That’s…
-
·
Then /^STDOUT should be CSV containing:$/
Expect STDOUT to be CSV containing certain values. Usage Scenario: My example scenario When I run `wp term list post_tag –fields=name,slug –format=csv` Then STDOUT should be CSV containing: | name | slug | | Test term | test | Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please…
-
·
Then /^STDOUT should be JSON containing:$/
Expect valid JSON output in STDOUT. Usage Scenario: My example scenario When I run `wp post meta get 1 meta-key –format=json` Then STDOUT should be JSON containing: “”” { “foo”: “baz” } “”” Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request. Related Then…