Replace remaining code references to runcommand namespace

This commit is contained in:
Alain Schlesser 2021-04-19 14:28:55 +01:00
parent 8eeb523227
commit 7b5c5f01f9
3 changed files with 5 additions and 5 deletions

View file

@ -5,10 +5,10 @@ Feature: Profile arbitary file execution
And a lame-function.php file: And a lame-function.php file:
""" """
<?php <?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` 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`

View file

@ -5,12 +5,12 @@ Feature: Profile arbitary code execution
And a wp-content/mu-plugins/lame-function.php file: And a wp-content/mu-plugins/lame-function.php file:
""" """
<?php <?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: Then STDOUT should be a table containing rows:
| query_time | query_count | cache_ratio | cache_hits | cache_misses | request_time | request_count | | query_time | query_count | cache_ratio | cache_hits | cache_misses | request_time | request_count |
| 0s | 0 | | 0 | 0 | 0s | 0 | | 0s | 0 | | 0 | 0 | 0s | 0 |

View file

@ -352,7 +352,7 @@ class Profiler {
$callback = 'function(){}'; $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; $this->tick_callback = null;
return; return;
} }