handbook/behat-steps/given-save-stdout-stderr-as.md
github-actions[bot] c22aa665e6 Regenerate handbook
2025-12-17 18:56:32 +00:00

5.8 KiB

Given /^save (STDOUT|STDERR) (['].+[^'])?\s?as {(\w+)}$/

Store STDOUT or STDERR contents in a variable.


Usage

Scenario: My example scenario
  When I run `wp package path`
  Then save STDOUT as {PACKAGE_PATH}

Scenario: My other scenario
  When I run `wp core download`
  Then save STDOUT 'Downloading WordPress ([\d\.]+)' as {VERSION}

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