You appear to be a bot. Output may be restricted
Description
Usage
gen_tests_array( $name, $array );
Parameters
- $name
- ( mixed ) required –
- $array
- ( mixed ) required –
Returns
void
Source
File name: wordpress-develop-tests/phpunit/includes/utils.php
Lines:
1 to 20 of 20
function gen_tests_array( $name, $array ) { $out = array(); foreach ( $array as $k => $v ) { if ( is_numeric( $k ) ) { $index = (string) $k; } else { $index = "'" . addcslashes( $k, "\n\r\t'\\" ) . "'"; } if ( is_string( $v ) ) { $out[] = '$this->assertEquals( \'' . addcslashes( $v, "\n\r\t'\\" ) . '\', $' . $name . '[' . $index . '] );'; } elseif ( is_numeric( $v ) ) { $out[] = '$this->assertEquals( ' . $v . ', $' . $name . '[' . $index . '] );'; } elseif ( is_array( $v ) ) { $out[] = gen_tests_array( "{$name}[{$index}]", $v ); } } return implode( "\n", $out ) . "\n"; }