From 282022dbd29084763cdc8ed6ff51054238ef2ec3 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Mon, 20 Aug 2018 13:41:25 -0400 Subject: [PATCH] Fix test failure --- app/appConf/minify_config.php | 69 ------------------- .../Kitsu/Transformer/MangaTransformer.php | 3 +- ...MangaTransformerTest__testTransform__1.php | 6 +- tests/AnimeClientTest.php | 2 - .../test_data/Kitsu/mangaBeforeTransform.json | 2 +- 5 files changed, 7 insertions(+), 75 deletions(-) delete mode 100644 app/appConf/minify_config.php diff --git a/app/appConf/minify_config.php b/app/appConf/minify_config.php deleted file mode 100644 index d06dd41c..00000000 --- a/app/appConf/minify_config.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @copyright 2015 - 2017 Timothy J. Warren - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @version 4.0 - * @link https://github.com/timw4mail/HummingBirdAnimeClient - */ - -// -------------------------------------------------------------------------- - -return [ - - /* - |-------------------------------------------------------------------------- - | JS Folder - |-------------------------------------------------------------------------- - | - | The folder where javascript files exist, in relation to the document root - | - */ - 'js_root' => 'js/', - - /* - |-------------------------------------------------------------------------- - | JS Groups - |-------------------------------------------------------------------------- - | - | Config array for javascript files to concatenate and minify - | - */ - 'groups' => [ - 'base' => [ - 'base/classList.js', - 'base/AnimeClient.js', - ], - 'event' => [ - 'base/events.js', - ], - 'table' => [ - 'base/sort_tables.js', - ], - 'table_edit' => [ - 'base/sort_tables.js', - 'anime_edit.js', - 'manga_edit.js', - ], - 'edit' => [ - 'anime_edit.js', - 'manga_edit.js', - ], - 'anime_collection' => [ - 'anime_search_results.js', - 'anime_collection.js', - ], - 'manga_collection' => [ - 'manga_search_results.js', - 'manga_collection.js', - ], - ] -]; -// End of minify_config.php \ No newline at end of file diff --git a/src/API/Kitsu/Transformer/MangaTransformer.php b/src/API/Kitsu/Transformer/MangaTransformer.php index 32c5ad9c..17c2b87f 100644 --- a/src/API/Kitsu/Transformer/MangaTransformer.php +++ b/src/API/Kitsu/Transformer/MangaTransformer.php @@ -46,7 +46,8 @@ final class MangaTransformer extends AbstractTransformer { sort($genres); $title = $item['canonicalTitle']; - $titles = array_unique(array_diff($item['titles'], [$title])); + $rawTitles = array_values($item['titles']); + $titles = array_unique(array_diff($rawTitles, [$title])); return new MangaPage([ 'id' => $item['id'], diff --git a/tests/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.php b/tests/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.php index fa06654c..f29c6889 100644 --- a/tests/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.php +++ b/tests/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.php @@ -1,16 +1,18 @@ '-', 'cover_image' => 'https://media.kitsu.io/manga/poster_images/20286/small.jpg?1434293999', - 'en_title' => NULL, 'genres' => array ( ), 'id' => '20286', - 'jp_title' => 'Bokura wa Minna Kawaisou', 'manga_type' => 'manga', 'synopsis' => 'Usa, a high-school student aspiring to begin a bachelor lifestyle, moves into a new apartment only to discover that he not only shares a room with a perverted roommate that has an obsession for underaged girls, but also that another girl, Ritsu, a love-at-first-sight, is living in the same building as well! (Source: Kirei Cake)', 'title' => 'Bokura wa Minna Kawaisou', + 'titles' => + array ( + 0 => NULL, + ), 'url' => 'https://kitsu.io/manga/bokura-wa-minna-kawaisou', 'volume_count' => '-', )); diff --git a/tests/AnimeClientTest.php b/tests/AnimeClientTest.php index 3414f4f2..9a52d90d 100644 --- a/tests/AnimeClientTest.php +++ b/tests/AnimeClientTest.php @@ -51,8 +51,6 @@ class AnimeClientTest extends AnimeClientTestCase $toml = arrayToToml($arr); - echo $toml . "\n"; - $parsedArray = tomlToArray($toml); $this->assertEquals($arr, $parsedArray); diff --git a/tests/test_data/Kitsu/mangaBeforeTransform.json b/tests/test_data/Kitsu/mangaBeforeTransform.json index a28dc569..6126fc64 100644 --- a/tests/test_data/Kitsu/mangaBeforeTransform.json +++ b/tests/test_data/Kitsu/mangaBeforeTransform.json @@ -10,7 +10,7 @@ "synopsis": "Usa, a high-school student aspiring to begin a bachelor lifestyle, moves into a new apartment only to discover that he not only shares a room with a perverted roommate that has an obsession for underaged girls, but also that another girl, Ritsu, a love-at-first-sight, is living in the same building as well!\n(Source: Kirei Cake)", "coverImageTopOffset": 40, "titles": { - "en": null, + "en_us": null, "en_jp": "Bokura wa Minna Kawaisou" }, "canonicalTitle": "Bokura wa Minna Kawaisou",