Changeset 55028
- Timestamp:
- 01/04/2023 02:16:57 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/utils.php
r54855 r55028 432 432 } 433 433 434 function get_echo( $call able, $args = array() ) {434 function get_echo( $callback, $args = array() ) { 435 435 ob_start(); 436 call_user_func_array( $call able, $args );436 call_user_func_array( $callback, $args ); 437 437 return ob_get_clean(); 438 438 } 439 439 440 440 // Recursively generate some quick assertEquals() tests based on an array. 441 function gen_tests_array( $name, $ array) {441 function gen_tests_array( $name, $expected_data ) { 442 442 $out = array(); 443 foreach ( $array as $k => $v ) { 443 444 foreach ( $expected_data as $k => $v ) { 444 445 if ( is_numeric( $k ) ) { 445 446 $index = (string) $k; … … 456 457 } 457 458 } 459 458 460 return implode( "\n", $out ) . "\n"; 459 461 }
Note: See TracChangeset
for help on using the changeset viewer.