handbook/references/behat-steps/then-stdout-should-end-with-a-table-containing-rows.md
Pascal Birchler 264cb131bf
Fix handbook information architecture
- Organize files in folders according to the desired structure
- Use directory iterator to loop through all files and folders (makes generation more robust)
2025-06-25 15:38:39 +02:00

5 KiB

Then /^STDOUT should end with a table containing rows:$/

Expect STDOUT to end with a table containing the given rows.


Usage

Useful when the table is preceded by some other output.

Scenario: My example scenario
  Given a WP installation
  When I run `wp search-replace foo bar --report-changed-only`
  Then STDOUT should contain:
    """
    Success: Made 3 replacements.
    """
  And STDOUT should end with a table containing rows:
    | Table       | Column       | Replacements | Type |
    | wp_options  | option_value | 1            | PHP  |
    | wp_postmeta | meta_value   | 1            | SQL  |
    | wp_posts    | post_title   | 1            | SQL  |

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