mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +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;
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,4 +77,14 @@ class DateTimeFormatTest extends MockedTest
|
|||
|
||||
self::assertEquals($assert, $dtFormat->isYearMonth($input));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the api_date() function.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApiDate()
|
||||
{
|
||||
self::assertEquals('Wed Oct 10 00:00:00 +0000 1990', DateTimeFormat::utc('1990-10-10', DateTimeFormat::API));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue