From 7c796b3d7bbe2794bbb014100aaf81e365a9692b Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Fri, 13 Mar 2020 09:53:31 -0400 Subject: [PATCH] Cleanup some build/quality check stuff --- Jenkinsfile | 1 + RoboFile.php | 29 +++++++ .../Operators/LogicalOperatorAndSniff.php | 81 ------------------ .../UppercaseLogicalOperatorOrSniff.php | 84 ------------------- build/CodeIgniter/ruleset.xml | 2 +- composer.json | 6 +- phpdox.xml | 18 ++-- psalm.xml | 55 ------------ src/AnimeClient/Controller.php | 13 ++- src/AnimeClient/constants.php | 5 -- ...eListTransformerTest__testTransform__1.yml | 28 +++++++ ...st__testUntransform with data set 0__1.yml | 13 +++ ...st__testUntransform with data set 1__1.yml | 13 +++ ...st__testUntransform with data set 2__1.yml | 12 +++ ...AnimeTransformerTest__testTransform__1.yml | 33 ++++++++ ...aListTransformerTest__testTransform__1.yml | 65 ++++++++++++-- ...MangaTransformerTest__testTransform__1.yml | 19 +++++ tests/AnimeClient/FormGeneratorTest.php | 5 -- ...eHelper with data set Full webp URL__1.txt | 1 + ...lper with data set Partial webp URL__1.txt | 1 + ...with data set bmp with gif fallback__1.txt | 1 + ...ictureHelper with data set jpeg2000__1.txt | 1 + ...with data set png placeholder image__1.txt | 1 + ...ta set simple image with attributes__1.txt | 1 + ...png fallback and lots of attributes__1.txt | 1 + ...ith data set webp placeholder image__1.txt | 1 + 26 files changed, 232 insertions(+), 258 deletions(-) delete mode 100644 build/CodeIgniter/Sniffs/Operators/LogicalOperatorAndSniff.php delete mode 100644 build/CodeIgniter/Sniffs/Operators/UppercaseLogicalOperatorOrSniff.php delete mode 100644 psalm.xml create mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.yml create mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 0__1.yml create mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 1__1.yml create mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 2__1.yml create mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.yml create mode 100644 tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.yml create mode 100644 tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set Full webp URL__1.txt create mode 100644 tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set Partial webp URL__1.txt create mode 100644 tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set bmp with gif fallback__1.txt create mode 100644 tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set jpeg2000__1.txt create mode 100644 tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set png placeholder image__1.txt create mode 100644 tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set simple image with attributes__1.txt create mode 100644 tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set svg with png fallback and lots of attributes__1.txt create mode 100644 tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set webp placeholder image__1.txt diff --git a/Jenkinsfile b/Jenkinsfile index 10e788e4..7fb02a70 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,7 @@ pipeline { agent any steps { sh 'curl -sS https://getcomposer.org/installer | php' + sh 'rm -rf ./vendor' sh 'rm -f composer.lock' sh 'php composer.phar install --ignore-platform-reqs' } diff --git a/RoboFile.php b/RoboFile.php index b7b50e3d..6a98e8f8 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -60,6 +60,7 @@ class RoboFile extends Tasks { $this->lint(); $this->phploc(TRUE); $this->phpcs(TRUE); + $this->phpmd(TRUE); $this->dependencyReport(); $this->phpcpdReport(); } @@ -157,6 +158,30 @@ class RoboFile extends Tasks { $this->_run($cmd_parts); } + public function phpmd($report = FALSE): void + { + $report_cmd_parts = [ + 'vendor/bin/phpmd', + './src', + 'xml', + 'cleancode,codesize,controversial,design,naming,unusedcode', + '--exclude ParallelAPIRequest', + '--reportfile ./build/logs/phpmd.xml' + ]; + + $normal_cmd_parts = [ + 'vendor/bin/phpmd', + './src', + 'ansi', + 'cleancode,codesize,controversial,design,naming,unusedcode', + '--exclude ParallelAPIRequest' + ]; + + $cmd_parts = ($report) ? $report_cmd_parts : $normal_cmd_parts; + + $this->_run($cmd_parts); + } + /** * Run the phploc tool * @@ -236,6 +261,10 @@ class RoboFile extends Tasks { glob('*.php') ); + $files = array_filter($files, static function(string $value) { + return strpos($value, '__snapshots__') === FALSE; + }); + sort($files); return $files; diff --git a/build/CodeIgniter/Sniffs/Operators/LogicalOperatorAndSniff.php b/build/CodeIgniter/Sniffs/Operators/LogicalOperatorAndSniff.php deleted file mode 100644 index d7af22aa..00000000 --- a/build/CodeIgniter/Sniffs/Operators/LogicalOperatorAndSniff.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @copyright 2006 Thomas Ernest - * @license http://thomas.ernest.fr/developement/php_cs/licence GNU General Public License - * @link http://pear.php.net/package/PHP_CodeSniffer - */ - -/** - * CodeIgniter_Sniffs_Operators_LogicalOperatorAndSniff. - * - * Ensures that the logical operator 'AND' is in upper case and suggest the use of its symbolic equivalent. - * - * @category PHP - * @package PHP_CodeSniffer - * @author Thomas Ernest - * @copyright 2006 Thomas Ernest - * @license http://thomas.ernest.fr/developement/php_cs/licence GNU General Public License - * @link http://pear.php.net/package/PHP_CodeSniffer - */ - -namespace CodeIgniter\Sniffs\Operators; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class LogicalOperatorAndSniff implements Sniff -{ - /** - * Returns an array of tokens this test wants to listen for: symbolic and literal operators and. - * - * @return array - */ - public function register() - { - return array( - T_LOGICAL_AND, - ); - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param File $phpcsFile The current file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $operator_token = $tokens[$stackPtr]; - $operator_string = $operator_token['content']; - $operator_code = $operator_token['code']; - - if ($operator_string !== strtoupper($operator_string)) { - $error_message = 'Logical operator should be in upper case;' - . ' use "' . strtoupper($operator_string) - . '" instead of "' . $operator_string . '"'; - $phpcsFile->addError($error_message, $stackPtr, 'LowercaseLogicalOperator'); - } - - $warning_message = 'The symbolic form "&&" is preferred over the literal form "AND"'; - $phpcsFile->addWarning($warning_message, $stackPtr, 'UseOfLiteralAndOperator'); - - }//end process() - - -}//end class - -?> \ No newline at end of file diff --git a/build/CodeIgniter/Sniffs/Operators/UppercaseLogicalOperatorOrSniff.php b/build/CodeIgniter/Sniffs/Operators/UppercaseLogicalOperatorOrSniff.php deleted file mode 100644 index cda26c01..00000000 --- a/build/CodeIgniter/Sniffs/Operators/UppercaseLogicalOperatorOrSniff.php +++ /dev/null @@ -1,84 +0,0 @@ - - * @copyright 2006 Thomas Ernest - * @license http://thomas.ernest.fr/developement/php_cs/licence GNU General Public License - * @link http://pear.php.net/package/PHP_CodeSniffer - */ - -/** - * CodeIgniter_Sniffs_Operators_UppercaseLogicalOperatorOrSniff. - * - * Ensures that the logical operator 'OR' is in upper cases and its symbolic equivalent. - * - * @category PHP - * @package PHP_CodeSniffer - * @author Thomas Ernest - * @copyright 2006 Thomas Ernest - * @license http://thomas.ernest.fr/developement/php_cs/licence GNU General Public License - * @link http://pear.php.net/package/PHP_CodeSniffer - */ - -namespace CodeIgniter\Sniffs\Operators; - -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Files\File; - -class UppercaseLogicalOperatorOrSniff implements Sniff -{ - /** - * Returns an array of tokens this test wants to listen for: literal and symbolic operators or. - * - * @return array - */ - public function register() - { - return array( - T_BOOLEAN_OR, - T_LOGICAL_OR, - ); - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param File $phpcsFile The current file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $operator_token = $tokens[$stackPtr]; - $operator_string = $operator_token['content']; - $operator_code = $operator_token['code']; - - if ($operator_code == T_BOOLEAN_OR) { - $error_message = 'Logical operator "' . $operator_string - . '" is prohibited; use "OR" instead'; - $phpcsFile->addError($error_message, $stackPtr, 'UseOf||InsteadOfOR'); - } - // it is literal, if it is not symbolic - else if ($operator_string !== strtoupper($operator_string)) { - $error_message = 'Logical operator should be in upper case;' - . ' use "' . strtoupper($operator_string) - . '" instead of "' . $operator_string . '"'; - $phpcsFile->addError($error_message, $stackPtr, 'UseOfLowercaseOr'); - } - }//end process() - - -}//end class - -?> \ No newline at end of file diff --git a/build/CodeIgniter/ruleset.xml b/build/CodeIgniter/ruleset.xml index 83974072..43097d22 100644 --- a/build/CodeIgniter/ruleset.xml +++ b/build/CodeIgniter/ruleset.xml @@ -23,7 +23,7 @@ - + diff --git a/composer.json b/composer.json index 692c1c19..99964656 100644 --- a/composer.json +++ b/composer.json @@ -46,15 +46,15 @@ "filp/whoops": "^2.1", "pdepend/pdepend": "^2.2", "phploc/phploc": "^5.0", - "phpmd/phpmd": "^2.4", + "phpmd/phpmd": "^2.8", "phpstan/phpstan": "^0.12.0", "phpunit/phpunit": "^8.4.3", "roave/security-advisories": "dev-master", "robmorgan/phinx": "^0.10.6", "sebastian/phpcpd": "^4.1.0", - "spatie/phpunit-snapshot-assertions": "^2.2.1", + "spatie/phpunit-snapshot-assertions": "^4", "squizlabs/php_codesniffer": "^3.2.2", - "symfony/var-dumper": "^4.4.1", + "symfony/var-dumper": "^5", "theseer/phpdox": "*" }, "scripts": { diff --git a/phpdox.xml b/phpdox.xml index 9b64cbd1..69ace8bb 100644 --- a/phpdox.xml +++ b/phpdox.xml @@ -78,10 +78,10 @@ - + @@ -89,24 +89,18 @@ - - - + + - - - - - + diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 42f355b2..00000000 --- a/psalm.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AnimeClient/Controller.php b/src/AnimeClient/Controller.php index 450249eb..8e17f891 100644 --- a/src/AnimeClient/Controller.php +++ b/src/AnimeClient/Controller.php @@ -161,7 +161,7 @@ class Controller { return; } - if (null === $url) + if (NULL === $url) { $url = $util->isViewPage() ? (string) $this->request->getUri() @@ -201,7 +201,6 @@ class Controller { 'Forbidden', 'You must log in to perform this action.' ); - die(); } } @@ -297,18 +296,18 @@ class Controller { * @param int $httpCode * @param string $title * @param string $message - * @param string $long_message + * @param string $longMessage * @throws InvalidArgumentException * @throws ContainerException * @throws NotFoundException * @return void */ - public function errorPage(int $httpCode, string $title, string $message, string $long_message = ''): void + public function errorPage(int $httpCode, string $title, string $message, string $longMessage = ''): void { $this->outputHTML('error', [ 'title' => $title, 'message' => $message, - 'long_message' => $long_message + 'long_message' => $longMessage ], NULL, $httpCode); } @@ -384,7 +383,7 @@ class Controller { * * @param string $template * @param array $data - * @param HtmlView|null $view + * @param HtmlView|NULL $view * @param int $code * @throws InvalidArgumentException * @throws ContainerException @@ -393,7 +392,7 @@ class Controller { */ protected function outputHTML(string $template, array $data = [], $view = NULL, int $code = 200): void { - if (null === $view) + if (NULL === $view) { $view = new HtmlView($this->container); } diff --git a/src/AnimeClient/constants.php b/src/AnimeClient/constants.php index db046acd..3a54a8b0 100644 --- a/src/AnimeClient/constants.php +++ b/src/AnimeClient/constants.php @@ -133,11 +133,6 @@ const SETTINGS_MAP = [ ], ], ], - /* 'options' => [ - 'type' => 'subfield', - 'title' => 'Options', - 'fields' => [], - ] */ ], 'config' => [ 'kitsu_username' => [ diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.yml new file mode 100644 index 00000000..866e1a5b --- /dev/null +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testTransform__1.yml @@ -0,0 +1,28 @@ +empty: false +id: '15839442' +mal_id: '33206' +episodes: + watched: '-' + total: '-' + length: null +airing: + status: 'Currently Airing' + started: '2017-01-12' + ended: null +anime: + empty: false + age_rating: null + cover_image: 'https://media.kitsu.io/anime/poster_images/12243/small.jpg?1481144116' + genres: [Comedy, Fantasy, 'Slice of Life'] + id: '12243' + show_type: TV + slug: kobayashi-san-chi-no-maid-dragon + streaming_links: { } + title: 'Kobayashi-san Chi no Maid Dragon' + titles: ['Miss Kobayashi''s Dragon Maid', 小林さんちのメイドラゴン] +notes: null +private: false +rewatching: false +rewatched: 0 +user_rating: '-' +watching_status: current diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 0__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 0__1.yml new file mode 100644 index 00000000..22fb6164 --- /dev/null +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 0__1.yml @@ -0,0 +1,13 @@ +empty: false +id: 14047981 +anilist_item_id: null +mal_id: null +data: + empty: false + notes: 'Very formulaic.' + private: false + progress: 38 + ratingTwenty: 16 + reconsumeCount: 0 + reconsuming: false + status: current diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 1__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 1__1.yml new file mode 100644 index 00000000..6769276d --- /dev/null +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 1__1.yml @@ -0,0 +1,13 @@ +empty: false +id: 14047981 +anilist_item_id: null +mal_id: '12345' +data: + empty: false + notes: 'Very formulaic.' + private: true + progress: 38 + ratingTwenty: 16 + reconsumeCount: 0 + reconsuming: true + status: current diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 2__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 2__1.yml new file mode 100644 index 00000000..adc5fcbe --- /dev/null +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeListTransformerTest__testUntransform with data set 2__1.yml @@ -0,0 +1,12 @@ +empty: false +id: 14047983 +anilist_item_id: null +mal_id: '12347' +data: + empty: false + notes: '' + private: true + progress: 12 + reconsumeCount: 0 + reconsuming: true + status: current diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.yml new file mode 100644 index 00000000..f736c331 --- /dev/null +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/AnimeTransformerTest__testTransform__1.yml @@ -0,0 +1,33 @@ +empty: false +characters: { } +staff: { } +age_rating: R +age_rating_guide: 'Violence, Profanity' +cover_image: 'https://media.kitsu.io/anime/poster_images/7442/small.jpg?1418580054' +episode_count: 25 +episode_length: 24 +genres: { } +id: 32344 +included: + categories: { 23: { name: 'Super Power', slug: super-power, description: null }, 11: { name: Fantasy, slug: fantasy, description: '' }, 4: { name: Drama, slug: drama, description: '' }, 1: { name: Action, slug: action, description: '' } } + mappings: { 5686: { externalSite: myanimelist/anime, externalId: '16498', relationships: { media: { links: { self: 'https://kitsu.io/api/edge/mappings/5686/relationships/media', related: 'https://kitsu.io/api/edge/mappings/5686/media' } } } }, 14153: { externalSite: thetvdb/series, externalId: '267440', relationships: { media: { links: { self: 'https://kitsu.io/api/edge/mappings/14153/relationships/media', related: 'https://kitsu.io/api/edge/mappings/14153/media' } } } }, 15073: { externalSite: thetvdb/season, externalId: '514060', relationships: { media: { links: { self: 'https://kitsu.io/api/edge/mappings/15073/relationships/media', related: 'https://kitsu.io/api/edge/mappings/15073/media' } } } } } + streamingLinks: { 103: { url: 'http://www.crunchyroll.com/attack-on-titan', subs: [en], dubs: [ja], relationships: { streamer: { links: { self: 'https://kitsu.io/api/edge/streaming-links/103/relationships/streamer', related: 'https://kitsu.io/api/edge/streaming-links/103/streamer' } }, media: { links: { self: 'https://kitsu.io/api/edge/streaming-links/103/relationships/media', related: 'https://kitsu.io/api/edge/streaming-links/103/media' } } } }, 102: { url: 'http://www.hulu.com/attack-on-titan', subs: [en], dubs: [ja], relationships: { streamer: { links: { self: 'https://kitsu.io/api/edge/streaming-links/102/relationships/streamer', related: 'https://kitsu.io/api/edge/streaming-links/102/streamer' } }, media: { links: { self: 'https://kitsu.io/api/edge/streaming-links/102/relationships/media', related: 'https://kitsu.io/api/edge/streaming-links/102/media' } } } }, 101: { url: 'http://www.funimation.com/shows/attack-on-titan/videos/episodes', subs: [en], dubs: [ja], relationships: { streamer: { links: { self: 'https://kitsu.io/api/edge/streaming-links/101/relationships/streamer', related: 'https://kitsu.io/api/edge/streaming-links/101/streamer' } }, media: { links: { self: 'https://kitsu.io/api/edge/streaming-links/101/relationships/media', related: 'https://kitsu.io/api/edge/streaming-links/101/media' } } } }, 100: { url: t, subs: [en], dubs: [ja], relationships: { streamer: { links: { self: 'https://kitsu.io/api/edge/streaming-links/100/relationships/streamer', related: 'https://kitsu.io/api/edge/streaming-links/100/streamer' } }, media: { links: { self: 'https://kitsu.io/api/edge/streaming-links/100/relationships/media', related: 'https://kitsu.io/api/edge/streaming-links/100/media' } } } } } +show_type: TV +slug: attack-on-titan +status: 'Finished Airing' +streaming_links: + - { meta: { name: Crunchyroll, link: true, image: streaming-logos/crunchyroll.svg }, link: 'http://www.crunchyroll.com/attack-on-titan', subs: [en], dubs: [ja] } + - { meta: { name: Funimation, link: true, image: streaming-logos/funimation.svg }, link: 'http://www.funimation.com/shows/attack-on-titan/videos/episodes', subs: [en], dubs: [ja] } + - { meta: { name: Hulu, link: true, image: streaming-logos/hulu.svg }, link: 'http://www.hulu.com/attack-on-titan', subs: [en], dubs: [ja] } + - { meta: { name: Netflix, link: false, image: streaming-logos/netflix.svg }, link: t, subs: [en], dubs: [ja] } +synopsis: | + Several hundred years ago, humans were nearly exterminated by titans. Titans are typically several stories tall, seem to have no intelligence, devour human beings and, worst of all, seem to do it for the pleasure rather than as a food source. A small percentage of humanity survived by enclosing themselves in a city protected by extremely high walls, even taller than the biggest of titans. Flash forward to the present and the city has not seen a titan in over 100 years. Teenage boy Eren and his foster sister Mikasa witness something horrific as the city walls are destroyed by a colossal titan that appears out of thin air. As the smaller titans flood the city, the two kids watch in horror as their mother is eaten alive. Eren vows that he will murder every single titan and take revenge for all of mankind. + + (Source: ANN) +title: 'Attack on Titan' +titles: + - 'Attack on Titan' + - 'Shingeki no Kyojin' + - 進撃の巨人 +trailer_id: n4Nj6Y_SNYI +url: 'https://kitsu.io/anime/attack-on-titan' diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaListTransformerTest__testTransform__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaListTransformerTest__testTransform__1.yml index 87effff0..7e670c63 100644 --- a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaListTransformerTest__testTransform__1.yml +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaListTransformerTest__testTransform__1.yml @@ -1,5 +1,60 @@ -- null -- null -- null -- null -- null +- + empty: false + id: '15084773' + mal_id: '26769' + chapters: { read: 67, total: '-' } + volumes: { read: '-', total: '-' } + manga: { empty: false, genres: [Comedy, Romance, School, 'Slice of Life', Thriller], id: '20286', image: 'https://media.kitsu.io/manga/poster_images/20286/small.jpg?1434293999', slug: bokura-wa-minna-kawaisou, title: 'Bokura wa Minna Kawaisou', titles: { }, type: Manga, url: 'https://kitsu.io/manga/bokura-wa-minna-kawaisou' } + reading_status: current + notes: '' + rereading: false + reread: 0 + user_rating: 9 +- + empty: false + id: '15085607' + mal_id: '16' + chapters: { read: 17, total: 120 } + volumes: { read: '-', total: 14 } + manga: { empty: false, genres: [Comedy, Ecchi, Harem, Romance, Sports], id: '47', image: 'https://media.kitsu.io/manga/poster_images/47/small.jpg?1434249493', slug: love-hina, title: 'Love Hina', titles: { }, type: Manga, url: 'https://kitsu.io/manga/love-hina' } + reading_status: current + notes: '' + rereading: false + reread: 0 + user_rating: 7 +- + empty: false + id: '15084529' + mal_id: '35003' + chapters: { read: 16, total: '-' } + volumes: { read: '-', total: '-' } + manga: { empty: false, genres: [Comedy, Ecchi, 'Gender Bender', Romance, School, Sports, Supernatural], id: '11777', image: 'https://media.kitsu.io/manga/poster_images/11777/small.jpg?1438784325', slug: yamada-kun-to-7-nin-no-majo, title: 'Yamada-kun to 7-nin no Majo', titles: ['Yamada-kun and the Seven Witches'], type: Manga, url: 'https://kitsu.io/manga/yamada-kun-to-7-nin-no-majo' } + reading_status: current + notes: '' + rereading: false + reread: 0 + user_rating: 9 +- + empty: false + id: '15312827' + mal_id: '78523' + chapters: { read: 68, total: '-' } + volumes: { read: '-', total: '-' } + manga: { empty: false, genres: [Romance, School, 'Slice of Life'], id: '27175', image: 'https://media.kitsu.io/manga/poster_images/27175/small.jpg?1464379411', slug: relife, title: ReLIFE, titles: { }, type: Manga, url: 'https://kitsu.io/manga/relife' } + reading_status: current + notes: '' + rereading: false + reread: 0 + user_rating: '-' +- + empty: false + id: '15084769' + mal_id: '60815' + chapters: { read: 43, total: '-' } + volumes: { read: '-', total: '-' } + manga: { empty: false, genres: [Comedy, School, 'Slice of Life'], id: '25491', image: 'https://media.kitsu.io/manga/poster_images/25491/small.jpg?1434305043', slug: joshikausei, title: Joshikausei, titles: { }, type: Manga, url: 'https://kitsu.io/manga/joshikausei' } + reading_status: current + notes: '' + rereading: false + reread: 0 + user_rating: 8 diff --git a/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.yml b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.yml new file mode 100644 index 00000000..7ba6eb79 --- /dev/null +++ b/tests/AnimeClient/API/Kitsu/Transformer/__snapshots__/MangaTransformerTest__testTransform__1.yml @@ -0,0 +1,19 @@ +empty: false +characters: { } +chapter_count: '-' +cover_image: 'https://media.kitsu.io/manga/poster_images/20286/small.jpg?1434293999' +genres: { } +id: '20286' +included: + genres: { 3: { attributes: { name: Comedy, slug: comedy, description: null } }, 24: { attributes: { name: School, slug: school, description: null } }, 16: { attributes: { name: 'Slice of Life', slug: slice-of-life, description: '' } }, 14: { attributes: { name: Romance, slug: romance, description: '' } }, 18: { attributes: { name: Thriller, slug: thriller, description: null } } } + mappings: { 48014: { attributes: { externalSite: myanimelist/manga, externalId: '26769' } } } +manga_type: manga +staff: { } +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: + - null +url: 'https://kitsu.io/manga/bokura-wa-minna-kawaisou' +volume_count: '-' diff --git a/tests/AnimeClient/FormGeneratorTest.php b/tests/AnimeClient/FormGeneratorTest.php index 816489a0..88b4b014 100644 --- a/tests/AnimeClient/FormGeneratorTest.php +++ b/tests/AnimeClient/FormGeneratorTest.php @@ -124,11 +124,6 @@ const SETTINGS_MAP = [ ], ], ], - /* 'options' => [ - 'type' => 'subfield', - 'title' => 'Options', - 'fields' => [], - ] */ ], 'config' => [ 'kitsu_username' => [ diff --git a/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set Full webp URL__1.txt b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set Full webp URL__1.txt new file mode 100644 index 00000000..9bff2462 --- /dev/null +++ b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set Full webp URL__1.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set Partial webp URL__1.txt b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set Partial webp URL__1.txt new file mode 100644 index 00000000..f33cf5e9 --- /dev/null +++ b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set Partial webp URL__1.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set bmp with gif fallback__1.txt b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set bmp with gif fallback__1.txt new file mode 100644 index 00000000..47747c2a --- /dev/null +++ b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set bmp with gif fallback__1.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set jpeg2000__1.txt b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set jpeg2000__1.txt new file mode 100644 index 00000000..73dc6c5a --- /dev/null +++ b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set jpeg2000__1.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set png placeholder image__1.txt b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set png placeholder image__1.txt new file mode 100644 index 00000000..41fcf6ad --- /dev/null +++ b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set png placeholder image__1.txt @@ -0,0 +1 @@ +placeholder.png \ No newline at end of file diff --git a/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set simple image with attributes__1.txt b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set simple image with attributes__1.txt new file mode 100644 index 00000000..a3cc6bed --- /dev/null +++ b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set simple image with attributes__1.txt @@ -0,0 +1 @@ +should exist \ No newline at end of file diff --git a/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set svg with png fallback and lots of attributes__1.txt b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set svg with png fallback and lots of attributes__1.txt new file mode 100644 index 00000000..f33e1a49 --- /dev/null +++ b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set svg with png fallback and lots of attributes__1.txt @@ -0,0 +1 @@ +Example text \ No newline at end of file diff --git a/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set webp placeholder image__1.txt b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set webp placeholder image__1.txt new file mode 100644 index 00000000..eb3de60d --- /dev/null +++ b/tests/AnimeClient/Helper/__snapshots__/PictureHelperTest__testPictureHelper with data set webp placeholder image__1.txt @@ -0,0 +1 @@ + \ No newline at end of file