mirror of
https://hk.gh-proxy.com/https://github.com/wp-cli/profile-command.git
synced 2025-08-20 06:28:31 +08:00
Replace remaining code references to runcommand namespace
This commit is contained in:
parent
8eeb523227
commit
7b5c5f01f9
3 changed files with 5 additions and 5 deletions
|
@ -5,10 +5,10 @@ Feature: Profile arbitary file execution
|
|||
And a lame-function.php file:
|
||||
"""
|
||||
<?php
|
||||
function runcommand_do_nothing() {
|
||||
function wp_cli_do_nothing() {
|
||||
|
||||
}
|
||||
runcommand_do_nothing();
|
||||
wp_cli_do_nothing();
|
||||
"""
|
||||
|
||||
When I run `wp profile eval-file lame-function.php --fields=query_time,query_count,cache_ratio,cache_hits,cache_misses,request_time,request_count`
|
||||
|
|
|
@ -5,12 +5,12 @@ Feature: Profile arbitary code execution
|
|||
And a wp-content/mu-plugins/lame-function.php file:
|
||||
"""
|
||||
<?php
|
||||
function runcommand_do_nothing() {
|
||||
function wp_cli_do_nothing() {
|
||||
|
||||
}
|
||||
"""
|
||||
|
||||
When I run `wp profile eval 'runcommand_do_nothing();' --fields=query_time,query_count,cache_ratio,cache_hits,cache_misses,request_time,request_count`
|
||||
When I run `wp profile eval 'wp_cli_do_nothing();' --fields=query_time,query_count,cache_ratio,cache_hits,cache_misses,request_time,request_count`
|
||||
Then STDOUT should be a table containing rows:
|
||||
| query_time | query_count | cache_ratio | cache_hits | cache_misses | request_time | request_count |
|
||||
| 0s | 0 | | 0 | 0 | 0s | 0 |
|
||||
|
|
|
@ -352,7 +352,7 @@ class Profiler {
|
|||
$callback = 'function(){}';
|
||||
}
|
||||
|
||||
if ( 'runcommand\Profile\Profiler->wp_tick_profile_begin()' === $callback ) {
|
||||
if ( 'WP_CLI\Profile\Profiler->wp_tick_profile_begin()' === $callback ) {
|
||||
$this->tick_callback = null;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue