mirror of
https://hk.gh-proxy.com/https://github.com/wp-cli/profile-command.git
synced 2025-08-21 06:39:02 +08:00
When we throw an Exception to bail out of the call, this means the rest of the bootstrap code hasn't executed, and important things aren't set up. Instead, we need to summarize early.
29 lines
875 B
Gherkin
29 lines
875 B
Gherkin
Feature: Profile a specific hook
|
|
|
|
Scenario: Profile a hook before the template is loaded
|
|
Given a WP install
|
|
|
|
When I run `wp profile --hook=plugins_loaded --fields=callback`
|
|
Then STDOUT should be a table containing rows:
|
|
| callback |
|
|
And STDERR should be empty
|
|
|
|
Scenario: Profile a hook without any callbacks
|
|
Given a WP install
|
|
|
|
When I run `wp profile --hook=setup_theme --fields=callback`
|
|
Then STDOUT should be a table containing rows:
|
|
| callback |
|
|
| total |
|
|
And STDERR should be empty
|
|
|
|
Scenario: Profile a hook that has actions with output
|
|
Given a WP install
|
|
|
|
When I run `wp profile --hook=wp_head --fields=callback`
|
|
Then STDOUT should be a table containing rows:
|
|
| callback |
|
|
And STDOUT should not contain:
|
|
"""
|
|
<meta name="generator"
|
|
"""
|