Move last legacy API tests & adapt phpunit.xml
This commit is contained in:
@@ -127,4 +127,42 @@ class ArraysTest extends TestCase
|
||||
$str = Arrays::recursiveImplode([[1], [2, [3]]], ',');
|
||||
self::assertSame($str, '{1},{2,{3}}');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the Arrays::walkRecursive() function.
|
||||
*/
|
||||
public function testApiWalkRecursive()
|
||||
{
|
||||
$array = ['item1'];
|
||||
self::assertEquals(
|
||||
$array,
|
||||
Arrays::walkRecursive(
|
||||
$array,
|
||||
function () {
|
||||
// Should we test this with a callback that actually does something?
|
||||
return true;
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the Arrays::walkRecursive() function with an array.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApiWalkRecursiveWithArray()
|
||||
{
|
||||
$array = [['item1'], ['item2']];
|
||||
self::assertEquals(
|
||||
$array,
|
||||
Arrays::walkRecursive(
|
||||
$array,
|
||||
function () {
|
||||
// Should we test this with a callback that actually does something?
|
||||
return true;
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user