title: "Then /^STDOUT should end with a table containing rows:$/" post_status: publish comment_status: open taxonomy: category: - wp-cli-handbook post_tag: - Behat Steps - Repos - Data


Then /^STDOUT should end with a table containing rows:$/

期望 STDOUT 以包含指定行的表格结尾。


用法

当表格前有其他输出内容时很有用。

场景:我的示例场景
  假设有一个 WordPress 安装
  当我运行 `wp search-replace foo bar --report-changed-only`
  那么 STDOUT 应包含:
    """
    成功:完成 3 处替换。
    """
  并且 STDOUT 应以包含以下行的表格结尾:
    | 表名        | 列名         | 替换次数 | 类型 |
    | wp_options  | option_value | 1        | PHP  |
    | wp_postmeta | meta_value   | 1        | SQL  |
    | wp_posts    | post_title   | 1        | SQL  |

Behat 步骤文档随每次 WP-CLI 版本发布从代码库自动生成。如需改进建议,请提交拉取请求。

相关