Version 5.1 - All the GraphQL #32

Closed
timw4mail wants to merge 1160 commits from develop into master
2 changed files with 33 additions and 1 deletions
Showing only changes of commit b7a2eafc0d - Show all commits

View File

@ -416,7 +416,7 @@ final class Kitsu {
* @param array $existingTitles * @param array $existingTitles
* @return bool * @return bool
*/ */
private static function titleIsUnique(?string $title = '', array $existingTitles = []): bool protected static function titleIsUnique(?string $title = '', array $existingTitles = []): bool
{ {
if (empty($title)) if (empty($title))
{ {

View File

@ -122,4 +122,36 @@ class KitsuTest extends TestCase {
$this->assertEquals($expected, $actual); $this->assertEquals($expected, $actual);
} }
public function testFilterLocalizedTitles()
{
$input = [
'canonical' => 'foo',
'localized' => [
'en' => 'Foo the Movie',
'fr' => '',
'jp' => NULL,
],
'alternatives' => [],
];
$actual = Kitsu::filterLocalizedTitles($input);
$this->assertEquals(['Foo the Movie'], $actual);
}
public function testGetFilteredTitles()
{
$input = [
'canonical' => 'foo',
'localized' => [
'en' => 'Foo the Movie'
],
'alternatives' => [],
];
$actual = Kitsu::getFilteredTitles($input);
$this->assertEquals(['Foo the Movie'], $actual);
}
} }