Source: Make WordPress: CLI

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

  • Given /^save the (.+) file ([’].+[^’])?as {(w+)}$/

    Stores the contents of the given file in a variable. Usage Scenario: My example scenario Given a WP installation with Composer And save the {RUN_DIR}/composer.json file as {COMPOSER_JSON} 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…

  • Given /^that HTTP requests to (.*?) will respond with:$/

    Mock HTTP requests to a given URL. Usage Scenario: My example scenario Given that HTTP requests to https://api.github.com/repos/wp-cli/wp-cli/releases?per_page=100 will respond with: “”” HTTP/1.1 200 Content-Type: application/json { “foo”: “bar” } “”” 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…

  • Given /^a WP( d[^s]+)? install(?:ation)?$/

    Installs WordPress. Usage Scenario: My example scenario Given a WP installation … Scenario: My other scenario Given a WP install … Scenario: My version-specific scenario Given a WP 6.4.2 installation … 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…

  • Given /^a WP multisite (subdirectory|subdomain)?s?(install|installation)$/

    Installs WordPress Multisite. Usage Supports either subdirectory or subdomain installation. Scenario: My example scenario Given a WP multisite subdomain installation … Scenario: My other scenario Given a WP subdirectory install … 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…

  • Given a database

    Creates an empty database. Usage Has no effect when tests run with SQLite. Scenario: My example scenario Given a database … 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. Given /^an? (empty|non-existent) ([^\s]+)…

  • Given a dependency on current wp-cli

    Add wp-cli/wp-cli as a Composer dependency. Usage Scenario: My example scenario Given a WP installation with Composer And a dependency on current wp-cli 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. Given /^an?…

  • Given /^a downloaded Phar with (?:the same version|version "([^"]+)")$/

    Download a specific WP-CLI Phar version from GitHub. Usage Scenario: My example scenario Given an empty directory And a downloaded Phar with version “2.11.0” Scenario: My other scenario Given an empty directory And a downloaded Phar with the same version Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements,…

  • Given a misconfigured WP_CONTENT_DIR constant directory

    Modify wp-config.php to set WP_CONTENT_DIR to an empty string. Usage Scenario: My example scenario Given a WP install And a misconfigured WP_CONTENT_DIR constant directory 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. Given…

  • Given /^a new Phar with (?:the same version|version "([^"]+)")$/

    Build a new WP-CLI Phar file with a given version. Usage Scenario: My example scenario Given an empty directory And a new Phar with version “2.11.0” 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…