title: "Then /^the (.+) (file|directory) should( strictly)? (exist|not exist|be:|contain:|not contain:)$/" post_status: publish comment_status: open taxonomy: category: - wp-cli-handbook post_tag: - Behat Steps - References - Repos


Then /^the (.+) (file|directory) should( strictly)? (exist|not exist|be:|contain:|not contain:)$/

期望某个文件或目录(不)存在,或(不)包含特定内容。


用法

Scenario: 我的示例场景
  When I run `wp core download`
  Then the wp-settings.php file should exist
  And the wp-content directory should exist
  And the {RUN_DIR} directory should contain:
    """
    index.php
    license.txt
    """
  And the wp-config.php file should contain:
    """
    That's all, stop editing! Happy publishing.
    """

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


相关