mirror of
https://hk.gh-proxy.com/https://github.com/wp-cli/profile-command.git
synced 2025-11-23 04:57:05 +08:00
Compare commits
4 commits
71c6a545ba
...
14f83fdbdb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14f83fdbdb | ||
|
|
7ed71902b4 | ||
|
|
6ca81ab917 | ||
|
|
1ad13345ff |
1 changed files with 23 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ Feature: Profile a specific hook
|
|||
<meta name="generator"
|
||||
"""
|
||||
|
||||
@require-wp-4.0
|
||||
@require-wp-4.0 @less-than-wp-6.9
|
||||
Scenario: Profile the shutdown hook
|
||||
Given a WP install
|
||||
And a wp-content/mu-plugins/shutdown.php file:
|
||||
|
|
@ -86,6 +86,28 @@ Feature: Profile a specific hook
|
|||
| total (2) | 0 | 1 |
|
||||
And STDERR should be empty
|
||||
|
||||
# `_wp_cron` was added to shutdown hook in 6.9, see https://core.trac.wordpress.org/changeset/60925.
|
||||
@require-wp-6.9
|
||||
Scenario: Profile the shutdown hook
|
||||
Given a WP install
|
||||
And a wp-content/mu-plugins/shutdown.php file:
|
||||
"""
|
||||
<?php
|
||||
function wp_cli_shutdown_hook() {
|
||||
wp_cache_get( 'foo' );
|
||||
}
|
||||
add_action( 'shutdown', 'wp_cli_shutdown_hook' );
|
||||
"""
|
||||
|
||||
When I run `wp profile hook shutdown --fields=callback,cache_hits,cache_misses`
|
||||
Then STDOUT should be a table containing rows:
|
||||
| callback | cache_hits | cache_misses |
|
||||
| wp_cli_shutdown_hook() | 0 | 1 |
|
||||
| wp_ob_end_flush_all() | 0 | 0 |
|
||||
| _wp_cron() | 0 | 0 |
|
||||
| total (3) | 0 | 1 |
|
||||
And STDERR should be empty
|
||||
|
||||
@require-wp-4.0
|
||||
Scenario: Indicate where a callback is defined with profiling a hook
|
||||
Given a WP install
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue