Merge "Added utility method taking an array of elements and wrapping each element in it's own array."
This commit is contained in:
commit
d996871d6b
1 changed files with 20 additions and 0 deletions
|
|
@ -385,6 +385,26 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
|
|||
$this->assertFalse( $r, "found extra row (after #$i)" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method taking an array of elements and wrapping
|
||||
* each element in it's own array. Useful for data providers
|
||||
* that only return a single argument.
|
||||
*
|
||||
* @since 1.20
|
||||
*
|
||||
* @param array $elements
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function arrayWrap( array $elements ) {
|
||||
return array_map(
|
||||
function( $element ) {
|
||||
return array( $element );
|
||||
},
|
||||
$elements
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that two arrays are equal. By default this means that both arrays need to hold
|
||||
* the same set of values. Using additional arguments, order and associated key can also
|
||||
|
|
|
|||
Loading…
Reference in a new issue