那么 HTTP 状态码应为 :code 访问 http://localhost:8080 时预期的 HTTP 状态码。 用法 Scenario: 我的示例场景 Given 一个通过 Composer 安装的 WP And 一个用于服务 'WordPress' 的 PHP 内置 Web 服务器 Then HTTP 状态码应为 200 Behat 步骤文档在每次发布时从 WP-CLI 代码库生成。如需改进,请提交拉取请求。 相关 Then /^the return code should( not)? be (\d+)$/ - 期望上一个命令返回特定的退出码。 Then /^(STDOUT|STDERR) should( strictly)? (be|contain|not contain):$/ - 检查 STDOUT 或 STDERR 的内容。 Then /^(STDOUT|STDERR) should be a number$/ - 期望 STDOUT 或 STDERR 是一个数值。 Then /^(STDOUT|STDERR) should not be a number$/ - 期望 STDOUT 或 STDERR 不是一个数值。 Then /^STDOUT should be a table containing rows:$/ - 期望 STDOUT 是一个包含给定行的表格。 Then /^STDOUT should end with a table containing rows:$/ - 期望 STDOUT 以一个包含给定行的表格结尾。 Then /^STDOUT should be JSON containing:$/ - 期望 STDOUT 中包含有效的 JSON 输出。 Then /^STDOUT should be a JSON array containing:$/ - 期望 STDOUT 中包含有效的 JSON 数组输出。 Then /^STDOUT should be CSV containing:$/ - 期望 STDOUT 是包含特定值的 CSV。 Then /^STDOUT should be YAML containing:$/ - 期望 STDOUT 是包含特定内容的 YAML。 Then /^(STDOUT|STDERR) should be empty$/ - 期望 STDOUT 或 STDERR 为空。 Then /^(STDOUT|STDERR) should not be empty$/ - 期望 STDOUT 或 STDERR 不为空。 Then /^(STDOUT|STDERR) should be a version string (<|<=|>|>=|==|=|!=|<>) ([+\w.{}-]+)$/ - 期望 STDOUT 或 STDERR 是一个版本字符串,并与给定的版本进行比较。 Then /^the (.+) (file|directory) should( strictly)? (exist|not exist|be:|contain:|not contain:)$/ - 期望某个文件或目录(不)存在或(不)包含特定内容。 Then /^the contents of the (.+) file should( not)? match (((\/.+\/)|(#.+#))([a-z]+)?)$/ - 将文件内容与正则表达式进行匹配。 Then /^(STDOUT|STDERR) should( not)? match (((\/.+\/)|(#.+#))([a-z]+)?)$/ - 将 STDOUT 或 STDERR 与正则表达式进行匹配。 Then /^an email should (be sent|not be sent)$/ - 期望发送(或不发送)一封电子邮件。