File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ Feature: Profile a specific hook
6666 <meta name="generator"
6767 """
6868
69- @require-wp-4.0
69+ @require-wp-4.0 @less-than-wp-6.9
7070 Scenario : Profile the shutdown hook
7171 Given a WP install
7272 And a wp-content/mu-plugins/shutdown.php file:
@@ -86,6 +86,28 @@ Feature: Profile a specific hook
8686 | total (2 ) | 0 | 1 |
8787 And STDERR should be empty
8888
89+ # `_wp_cron` was added to shutdown hook in 6.9, see https://core.trac.wordpress.org/changeset/60925.
90+ @require-wp-6.9
91+ Scenario : Profile the shutdown hook
92+ Given a WP install
93+ And a wp-content/mu-plugins/shutdown.php file:
94+ """
95+ <?php
96+ function wp_cli_shutdown_hook() {
97+ wp_cache_get( 'foo' );
98+ }
99+ add_action( 'shutdown', 'wp_cli_shutdown_hook' );
100+ """
101+
102+ When I run `wp profile hook shutdown --fields=callback,cache_hits,cache_misses`
103+ Then STDOUT should be a table containing rows:
104+ | callback | cache_hits | cache_misses |
105+ | wp_cli_shutdown_hook () | 0 | 1 |
106+ | wp_ob_end_flush_all () | 0 | 0 |
107+ | _wp_cron () | 0 | 0 |
108+ | total (3 ) | 0 | 1 |
109+ And STDERR should be empty
110+
89111 @require-wp-4.0
90112 Scenario : Indicate where a callback is defined with profiling a hook
91113 Given a WP install
You can’t perform that action at this time.
0 commit comments