mirror of
https://github.com/friendica/friendica
synced 2025-05-02 08:24:22 +02:00
Move last legacy API tests & adapt phpunit.xml
This commit is contained in:
parent
732663ea6b
commit
fbefb599dc
7 changed files with 173 additions and 304 deletions
|
@ -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;
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue