handbook/behat-steps/then-stdout-stderr-should-strictly-be-contain-not-contain.md
github-actions[bot] c22aa665e6 Regenerate handbook
2025-12-17 18:56:32 +00:00

4.8 KiB

Then /^(STDOUT|STDERR) should( strictly)? (be|contain|not contain):$/

Check the contents of STDOUT or STDERR.


Usage

Scenario: My example scenario
  Given an empty directory
  When I run `wp core is-installed`
  Then STDOUT should be empty

Scenario: My other scenario
  Given a WP install
  When I run `wp plugin install akismet`
  Then STDOUT should contain:
    """
    Plugin installed successfully.
    """
  And STDERR should be empty

Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.