Feature: Profile a specific hook @require-wp-4.0 Scenario: Profile all hooks when a specific hook isn't specified Given a WP install When I run `wp profile hook --fields=hook` Then STDOUT should be a table containing rows: | hook | | plugins_loaded | | init | | template_redirect | And STDERR should be empty @require-wp-4.4 Scenario: Profile all callbacks when --all flag is used Given a WP install When I run `wp profile hook --all --fields=callback,cache_hits,cache_misses` Then STDOUT should be a table containing rows: | callback | cache_hits | cache_misses | | sanitize_comment_cookies() | 0 | 0 | @less-than-php-7 @require-wp-4.0 Scenario: Profile an intermediate stage hook Given a WP install When I run `wp profile hook wp_head:before --fields=callback,cache_hits,cache_misses` Then STDOUT should be a table containing rows: | callback | cache_hits | cache_misses | | parse_blocks() | 0 | 0 | | _get_wptexturize_split_regex() | 0 | 0 | And STDOUT should not contain: """ WP_CLI\Profile\Profiler->wp_tick_profile_begin() """ @require-wp-4.0 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 @require-wp-4.0 Scenario: Profile a hook without any callbacks Given a WP install When I run `wp profile hook get_search_form --fields=callback` Then STDOUT should be a table containing rows: | callback | | total (0) | And STDERR should be empty @require-wp-4.0 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: """