Compare commits

...

4 commits

Author SHA1 Message Date
Pascal Birchler
14f83fdbdb
Merge pull request #204 from wp-cli/fix/tests
Some checks failed
Code Quality Checks / code-quality (push) Has been cancelled
Testing / test (push) Has been cancelled
2025-10-13 13:13:03 +02:00
Pascal Birchler
7ed71902b4
Fix tests against trunk 2025-10-13 09:32:39 +02:00
swissspidy
6ca81ab917 Update file(s) from wp-cli/.github 2025-10-08 11:20:30 +00:00
swissspidy
1ad13345ff Update file(s) from wp-cli/.github 2025-10-08 09:39:35 +00:00

View file

@ -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