Move last legacy API tests & adapt phpunit.xml

This commit is contained in:
Philipp 2022-01-22 21:24:03 +01:00
parent 732663ea6b
commit fbefb599dc
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
7 changed files with 173 additions and 304 deletions

View file

@ -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;
}
)
);
}
}

View file

@ -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));
}
}