export-command/features/profile-stage.feature

119 lines
3.3 KiB
Gherkin
Raw Normal View History

Feature: Profile the template render stage
Scenario: Profiler loads a summary table
Given a WP install
When I run `wp profile stage --fields=stage`
Then STDOUT should be a table containing rows:
| stage |
| bootstrap |
| main_query |
| template |
Scenario: Profiler loads a table with the correct hooks
Given a WP install
2016-10-07 15:58:08 -07:00
When I run `wp profile stage bootstrap --fields=hook`
Then STDOUT should be a table containing rows:
| hook |
| |
| muplugins_loaded |
| |
| plugins_loaded |
| |
| setup_theme |
| |
| after_setup_theme |
| |
| init |
| |
| wp_loaded |
| |
| total |
When I run `wp profile stage main_query --fields=hook`
Then STDOUT should be a table containing rows:
| hook |
| |
| parse_request |
| |
| send_headers |
| |
| pre_get_posts |
| |
| the_posts |
| |
| wp |
| |
| total |
When I run `wp profile stage template --fields=hook`
Then STDOUT should be a table containing rows:
| hook |
| |
| template_redirect |
| |
| template_include |
| |
| wp_head |
| |
| loop_start |
| |
| loop_end |
| |
| wp_footer |
| |
| total |
2016-10-07 15:45:48 -07:00
Scenario: Use --all flag to profile all stages
Given a WP install
When I run `wp profile stage --all --fields=hook`
Then STDOUT should be a table containing rows:
| hook |
| |
| muplugins_loaded |
| |
| plugins_loaded |
| |
| setup_theme |
| |
| after_setup_theme |
| |
| init |
| |
| wp_loaded |
| |
| parse_request |
| |
| send_headers |
| |
| pre_get_posts |
| |
| the_posts |
| |
| wp |
| |
| template_redirect |
| |
| template_include |
| |
| wp_head |
| |
| loop_start |
| |
| loop_end |
| |
| wp_footer |
| |
| total |
Scenario: Invalid stage specified
Given a WP install
When I try `wp profile stage foo_bar`
Then STDERR should be:
"""
Error: Invalid stage. Must be one of bootstrap, main_query, template, or use --all.
"""