Repository navigation
test: coverage for genre/magazine/producer lists + Watch; fix apple-touch-icon and 2 latent bugs - #624
Merged
Conversation
…-touch-icon + 2 latent bugs
Closes 8 of the reported coverage gaps (scripts/generate_endpoints.php
--check): getAnimeGenres, getMangaGenres, getMagazines, getProducers,
getPopularEpisodes, getRecentEpisodes, getPopularPromotionalVideos,
getRecentPromotionalVideos now each have a test that drives the endpoint
parser. Coverage debt 30 -> 22.
New tests (all hermetic against fixture PR jikan-fixtures#6, recorded live
2026-10-12):
- test/unit/Parser/Genre/{Anime,Manga}GenreListParserTest
- test/unit/Parser/Magazine/MagazineListParserTest
- test/unit/Parser/Producer/ProducerListParserTest
- test/unit/Parser/Watch/{WatchEpisodesParserTest,WatchPromotionalVideosParserTest}
Bug fixes surfaced by the coverage work:
- ImagePlaceholder (jikan#488): artless anime/manga detail pages fall back to
the MAL site icon (/img/sp/icon/apple-touch-icon-256.png) as og:image; it is
now treated as a placeholder so getImageURL() resolves to null. Recorded
proof: AnimePlaceholderImageTest on anime/43535.
- Genre list parsers read the genre sections by position, which misaligns on
manga.php where MAL prepends an 'adapted from' genre-link block; both
parsers now anchor the four sections by content (blocks whose links are
/genre/ URLs).
- Model\Watch\EpisodeListItem::getEpisodes() declared return type
RecentEpisodeListItem but receives an array - every call threw a TypeError.
Also: CHANGELOG Fixed entries, DECISIONS fragment list refresh, regenerated
endpoint catalog (endpoints.json + llm.txt).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commi
3066
t.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / why
Closes 8 of the reported coverage gaps (
composer endpoints:check):getAnimeGenres,getMangaGenres,getMagazines,getProducers,getPopularEpisodes,getRecentEpisodes,getPopularPromotionalVideos,getRecentPromotionalVideos. Coverage debt 30 → 22.All new tests construct the endpoint parser from a recorded page and assert content the batch-1 way (ids / titles / counts / pagination):
test/unit/Parser/Genre/AnimeGenreListParserTest.phpGenre\AnimeGenreListParsertest/unit/Parser/Genre/MangaGenreListParserTest.phpGenre\MangaGenreListParsertest/unit/Parser/Magazine/MagazineListParserTest.phpMagazine\MagazineListParsertest/unit/Parser/Producer/ProducerListParserTest.phpProducer\ProducerListParsertest/unit/Parser/Watch/WatchEpisodesParserTest.phpWatch\WatchEpisodesParsertest/unit/Parser/Watch/WatchPromotionalVideosParserTest.phpWatch\WatchPromotionalVideosParserFixtures live in jikan-fixtures PR #6 — all recorded live 2026-10-12, status 200, no redirects.
Task A — jikan#488 apple-touch-icon
Verified live today on an artless anime page and an artless manga page: both serve
https://cdn.myanimelist.net/img/sp/icon/apple-touch-icon-256.pngasog:image(no cover, "Add Picture" button).ImagePlaceholdernow matches that fragment, and a recorded artless detail page (anime/43535) provesAnimeParser::getImageURL()→null:test/unit/Parser/Anime/AnimePlaceholderImageTest.phpImagePlaceholderTestextended (positive + negative cases, including other apple-touch-icon sizes as non-matches).Two latent bugs the new coverage surfaced (now fixed)
Model\Watch\EpisodeListItem::getEpisodes()declared return typeRecentEpisodeListItembut received the array the parser builds — every call threw a TypeError. Now returns theRecentEpisodeListItem[]list.manga.phpprepends an "adapted from"genre-linkblock (All / Airing Now / Upcoming) before the genre sections, soMangaGenreListParserreturned that block as "Genres". Both genre-list parsers now anchor the four sections by content (blocks whose links are/genre/URLs) — verified identical results on bothanime.phpandmanga.php.Verification
composer test— 449 tests (428 baseline + 21 new), 8 skipped (News), 0 failuresphp-cs-fixer fix --dry-runclean; grumphp pre-commit (cs-fixer, blacklist, paratest, phplint) + backend-suite gates (error_handling, test_network_coupling) cleancomposer endpoints:check— manifest OK, coverage 22 (down from 30);endpoints.json+llm.txtregeneratedtest/(recorded fixtures only)Remaining coverage debt (22)
recommended batch 3: CharactersAndStaff, Forum (×2), Reviews, MangaMoreInfo, Pictures (character/person), Character/Manga/Person search, Search recent-online-users + user search, NewsList/Article, Recent/User recommendations, User clubs/friends/reviews/username — plus the two raw JSON list readers (
getUserAnimeList/getUserMangaList, no parser, skip).