mirror of
https://gh.wpcy.net/https://github.com/wp-cli/handbook.git
synced 2026-04-27 04:16:23 +08:00
- Organize files in folders according to the desired structure - Use directory iterator to loop through all files and folders (makes generation more robust)
4.6 KiB
4.6 KiB
Then the HTTP status code should be :code
Expect the HTTP status code for visiting http://localhost:8080.
Usage
Scenario: My example scenario
Given a WP installation with Composer
And a PHP built-in web server to serve 'WordPress'
Then the HTTP status code should be 200
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 (\d+)$/ - Expect a specific exit code of the previous command.
- Then /^(STDOUT|STDERR) should( strictly)? (be|contain|not contain):$/ - Check the contents of STDOUT or STDERR.
- Then /^(STDOUT|STDERR) should be a number$/ - Expect STDOUT or STDERR to be a numeric value.
- Then /^(STDOUT|STDERR) should not be a number$/ - Expect STDOUT or STDERR to not be a numeric value.
- Then /^STDOUT should be a table containing rows:$/ - Expect STDOUT to be a table containing the given rows.
- Then /^STDOUT should end with a table containing rows:$/ - Expect STDOUT to end with a table containing the given rows.
- Then /^STDOUT should be JSON containing:$/ - Expect valid JSON output in STDOUT.
- Then /^STDOUT should be a JSON array containing:$/ - Expect valid JSON array output in STDOUT.
- Then /^STDOUT should be CSV containing:$/ - Expect STDOUT to be CSV containing certain values.
- Then /^STDOUT should be YAML containing:$/ - Expect STDOUT to be YAML containig certain content.
- Then /^(STDOUT|STDERR) should be empty$/ - Expect STDOUT or STDERR to be empty.
- Then /^(STDOUT|STDERR) should not be empty$/ - Expect STDOUT or STDERR not to be empty.
- Then /^(STDOUT|STDERR) should be a version string (<|<=|>|>=|==|=|!=|<>) ([+\w.{}-]+)$/ - Expect STDOUT or STDERR to be a version string comparing to the given version.
- 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.
- Then /^the contents of the (.+) file should( not)? match (((\/.+\/)|(#.+#))([a-z]+)?)$/ - Match file contents against a regex.
- Then /^(STDOUT|STDERR) should( not)? match (((\/.+\/)|(#.+#))([a-z]+)?)$/ - Match STDOUT or STDERR against a regex.
- Then /^an email should (be sent|not be sent)$/ - Expect an email to be sent (or not).