WordPress Help

Official documentation, learning resources, and contributor guides collected from WordPress.org.

  • Then /^(STDOUT|STDERR) should be empty$/

    Expect STDOUT or STDERR to be empty. Usage Scenario: My other scenario Given a WP install When I run `wp plugin install akismet` Then STDERR should 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)?…

    Read guide

  • 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…

    Read guide

  • 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…

    Read guide

  • 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)?…

    Read guide

  • 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…

    Read guide

  • 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…

    Read guide

  • 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…

    Read guide

  • Given download:

    Download multiple files into the given destinations. Usage Scenario: My example scenario Given download: | path | url | | {CACHE_DIR}/foo.jpg | https://example.com/foo.jpg | | {CACHE_DIR}/bar.png | https://example.com/another-image.png | Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request. Related Given an empty directory –…

    Read guide

  • Given /^"([^"]+)" replaced with "([^"]+)" in the ([^s]+) file$/

    Search and replace a string in a file using regex. Usage Scenario: My example scenario Given “Foo” replaced with “Bar” in the readme.html file … Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request. Related Given an empty directory – Creates an empty directory.…

    Read guide

  • Given /^save (STDOUT|STDERR) ([’].+[^’])?s?as {(w+)}$/

    Store STDOUT or STDERR contents in a variable. Usage Scenario: My example scenario When I run `wp package path` Then save STDOUT as {PACKAGE_PATH} Scenario: My other scenario When I run `wp core download` Then save STDOUT ‘Downloading WordPress ([\d\.]+)’ as {VERSION} Behat steps documentation is generated from the WP-CLI codebase on every release. To…

    Read guide