diff --git a/tests/phpunit/includes/utils.php b/tests/phpunit/includes/utils.php index 1b839878b5..30af6aa348 100644 --- a/tests/phpunit/includes/utils.php +++ b/tests/phpunit/includes/utils.php @@ -431,16 +431,17 @@ function dmp_filter( $a ) { return $a; } -function get_echo( $callable, $args = array() ) { +function get_echo( $callback, $args = array() ) { ob_start(); - call_user_func_array( $callable, $args ); + call_user_func_array( $callback, $args ); return ob_get_clean(); } // Recursively generate some quick assertEquals() tests based on an array. -function gen_tests_array( $name, $array ) { +function gen_tests_array( $name, $expected_data ) { $out = array(); - foreach ( $array as $k => $v ) { + + foreach ( $expected_data as $k => $v ) { if ( is_numeric( $k ) ) { $index = (string) $k; } else { @@ -455,6 +456,7 @@ function gen_tests_array( $name, $array ) { $out[] = gen_tests_array( "{$name}[{$index}]", $v ); } } + return implode( "\n", $out ) . "\n"; }