title: "Then /^STDOUT should be JSON containing:$/" post_status: publish comment_status: open taxonomy: category: - wp-cli-handbook post_tag: - Behat Steps - References - Repos


Then /^STDOUT should be JSON containing:$/

期望 STDOUT 中包含有效的 JSON 输出。


用法

场景:我的示例场景
  当我运行 `wp post meta get 1 meta-key --format=json`
  那么 STDOUT 应该包含 JSON:
    """
    {
    "foo": "baz"
    }
  """

Behat 步骤文档在每次发布时从 WP-CLI 代码库生成。如需改进,请提交拉取请求。


相关