title: "Then /^the contents of the (.+) file should( not)? match (((\/.+\/)|(#.+#))([a-z]+)?)$/" post_status: publish comment_status: open taxonomy: category: - wp-cli-handbook post_tag: - Behat Steps - Repos - Data


Then /^the contents of the (.+) file should( not)? match (((\/.+\/)|(#.+#))([a-z]+)?)$/

将文件内容与正则表达式进行匹配。


用法

Scenario: 我的示例场景
  When I run `wp scaffold plugin hello-world`
  Then the contents of the wp-content/plugins/hello-world/languages/hello-world.pot file should match /X-Generator:\s/

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

相关