2016-09-08 05:43:42 -07:00
|
|
|
Feature: Profile a specific hook
|
|
|
|
|
2016-09-23 06:33:30 -07:00
|
|
|
Scenario: Profile a hook before the template is loaded
|
|
|
|
Given a WP install
|
|
|
|
|
2016-10-04 06:47:01 -07:00
|
|
|
When I run `wp profile hook plugins_loaded --fields=callback`
|
2016-09-23 06:33:30 -07:00
|
|
|
Then STDOUT should be a table containing rows:
|
|
|
|
| callback |
|
|
|
|
And STDERR should be empty
|
|
|
|
|
2016-09-08 05:43:42 -07:00
|
|
|
Scenario: Profile a hook without any callbacks
|
|
|
|
Given a WP install
|
|
|
|
|
2016-10-04 06:47:01 -07:00
|
|
|
When I run `wp profile hook setup_theme --fields=callback`
|
2016-09-08 05:49:18 -07:00
|
|
|
Then STDOUT should be a table containing rows:
|
|
|
|
| callback |
|
|
|
|
| total |
|
2016-09-08 05:43:42 -07:00
|
|
|
And STDERR should be empty
|
2016-09-08 06:02:48 -07:00
|
|
|
|
|
|
|
Scenario: Profile a hook that has actions with output
|
|
|
|
Given a WP install
|
|
|
|
|
2016-10-04 06:47:01 -07:00
|
|
|
When I run `wp profile hook wp_head --fields=callback`
|
2016-09-08 06:02:48 -07:00
|
|
|
Then STDOUT should be a table containing rows:
|
|
|
|
| callback |
|
|
|
|
And STDOUT should not contain:
|
|
|
|
"""
|
|
|
|
<meta name="generator"
|
|
|
|
"""
|