export-command/features/profile-hook.feature
Daniel Bachhuber 25e1f40ea7 Fix profiling of early hooks
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.
2016-09-23 06:33:30 -07:00

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"
"""