*/ public static function animeReleaseProvider(): array { return [ 'animetosho poster catches non-TV-looking release' => [ '[SSA] Cestvs - The Roman Fighter - 08 [480p]', 'alt.binaries.multimedia.anime.highspeed', 'Anime Tosho ', ], 'animetosho poster catches subsplease release with hash' => [ '[SubsPlease] Cestvs - The Roman Fighter - 08 (720p) [26BDA3C9]', 'alt.binaries.multimedia.anime.highspeed', 'Anime Tosho ', ], 'animetosho poster catches yuisubs nvenc release' => [ '[YuiSubs] Cestvs - The Roman Fighter - 08 (NVENC H.265 1080p)', 'alt.binaries.multimedia.anime.highspeed', 'Anime Tosho ', ], 'animetosho poster catches nyanpasu hevc release' => [ '[Nyanpasu] Super Cub - 09 [1080p][HEVC][19475939]', 'alt.binaries.multimedia.anime.highspeed', 'Anime Tosho ', ], 'anime group name alone is enough' => [ '[QCE] Kami-tachi ni Hirowareta Otoko - 07', 'alt.binaries.multimedia.anime.highspeed', '', ], 'known anime release group tag (SSA) without S/E' => [ '[SSA] Hetalia World Stars - 10 [480p]', '', '', ], 'known anime release group tag (DKB) with media wrapper' => [ '[DKB] Kami-tachi ni Hirowareta Otoko - S01E07 [1080p][H.265 10bit]', '', '', ], 'anime hash pattern alone' => [ '[NS] Nanatsu No Taizai - Fundo No Shinpan - 21 - (1080p 10bit) [2C014CB1]', '', '', ], ]; } #[DataProvider('animeReleaseProvider')] public function test_anime_releases_are_categorized_as_tv_anime(string $name, string $groupName, string $poster): void { $categorizer = new TvCategorizer; $context = new ReleaseContext( releaseName: $name, groupId: 0, groupName: $groupName, poster: $poster, ); $result = $categorizer->categorize($context); $this->assertTrue($result->isSuccessful(), "Expected anime match for: {$name}"); $this->assertSame(Category::TV_ANIME, $result->categoryId, "Expected TV_ANIME for: {$name} (matched_by={$result->matchedBy})"); } public function test_group_name_categorizer_classifies_anime_usenet_group(): void { $categorizer = new GroupNameCategorizer; $context = new ReleaseContext( releaseName: 'some.random.release.name', groupId: 0, groupName: 'alt.binaries.multimedia.anime.highspeed', poster: '', ); $result = $categorizer->categorize($context); $this->assertTrue($result->isSuccessful()); $this->assertSame(Category::TV_ANIME, $result->categoryId); $this->assertSame('group_name_anime', $result->matchedBy); } }