Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
irfan-dahir committed Oct 23, 2022
1 parent 2fcd497 commit e2b6571
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function it_gets_status(): void
public function it_gets_episodes_seen(): void
{
self::assertEquals(
5,
null,
$this->model->getResults()[0]->getEpisodesSeen()
);
}
Expand All @@ -106,7 +106,7 @@ public function it_gets_episodes_seen(): void
public function it_gets_episodes_total(): void
{
self::assertEquals(
26,
null,
$this->model->getResults()[0]->getEpisodesTotal()
);
}
Expand Down
32 changes: 13 additions & 19 deletions test/JikanTest/Parser/Anime/AnimeReviewsParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Jikan\Parser\Anime\AnimeReviewsParser;
use Jikan\Request\Anime\AnimeReviewsRequest;
use JikanTest\TestCase;
use Symfony\Component\HttpClient\HttpClient;

class AnimeReviewsParserTest extends TestCase
{
Expand Down Expand Up @@ -61,15 +62,6 @@ public function it_gets_review_url(): void
self::assertEquals('https://myanimelist.net/reviews.php?id=7406', $this->review->getUrl());
}

/**
* @test
* @covers \Jikan\Parser\Anime\AnimeReviewsParser
*/
public function it_gets_review_votes_count(): void
{
self::assertEquals(2034, $this->review->getVotes());
}

/**
* @test
* @covers \Jikan\Parser\Anime\AnimeReviewsParser
Expand Down Expand Up @@ -98,7 +90,7 @@ public function it_gets_reviewer_username(): void
public function it_gets_reviewer_image_url(): void
{
self::assertEquals(
'https://cdn.myanimelist.net/images/userimages/11081.jpg?t=1654492800',
'https://cdn.myanimelist.net/images/userimages/11081.jpg?t=1666216200',
$this->review->getUser()->getImages()->getJpg()->getImageUrl()
);
}
Expand All @@ -122,7 +114,7 @@ public function it_gets_reviewer_url(): void
public function it_gets_reviewer_episodes_watched(): void
{
self::assertEquals(
26,
null,
$this->review->getEpisodesWatched()
);
}
Expand All @@ -131,14 +123,16 @@ public function it_gets_reviewer_episodes_watched(): void
* @test
* @covers \Jikan\Parser\Anime\AnimeReviewsParser
*/
public function it_gets_reviewer_scores(): void
public function it_gets_reviewer_reactions(): void
{
self::assertEquals(10, $this->review->getScores()->getOverall());
self::assertEquals(10, $this->review->getScores()->getStory());
self::assertEquals(9, $this->review->getScores()->getAnimation());
self::assertEquals(10, $this->review->getScores()->getSound());
self::assertEquals(10, $this->review->getScores()->getCharacter());
self::assertEquals(9, $this->review->getScores()->getEnjoyment());
self::assertEquals(2, $this->review->getReactions()->getLoveIt());
self::assertEquals(0, $this->review->getReactions()->getCreative());
self::assertEquals(0, $this->review->getReactions()->getWellWritten());
self::assertEquals(0, $this->review->getReactions()->getInformative());
self::assertEquals(0, $this->review->getReactions()->getConfusing());
self::assertEquals(1, $this->review->getReactions()->getFunny());
self::assertEquals(2087, $this->review->getReactions()->getNice());
self::assertEquals(2090, $this->review->getReactions()->getOverall());
}

/**
Expand All @@ -158,4 +152,4 @@ public function it_gets_reviewer_review(): void
}


}
}
28 changes: 11 additions & 17 deletions test/JikanTest/Parser/Manga/MangaReviewsParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ public function it_gets_review_url(): void
self::assertEquals('https://myanimelist.net/reviews.php?id=11794', $this->review->getUrl());
}

/**
* @test
* @covers \Jikan\Parser\Manga\MangaReviewsParser
*/
public function it_gets_review_votes_count(): void
{
self::assertEquals(411, $this->review->getVotes());
}

/**
* @test
* @covers \Jikan\Parser\Manga\MangaReviewsParser
Expand Down Expand Up @@ -122,7 +113,7 @@ public function it_gets_reviewer_url(): void
public function it_gets_reviewer_chapters_read(): void
{
self::assertEquals(
162,
null,
$this->review->getChaptersRead()
);
}
Expand All @@ -131,13 +122,16 @@ public function it_gets_reviewer_chapters_read(): void
* @test
* @covers \Jikan\Parser\Manga\MangaReviewsParser
*/
public function it_gets_reviewer_scores(): void
public function it_gets_reviewer_reactions(): void
{
self::assertEquals(10, $this->review->getScores()->getOverall());
self::assertEquals(10, $this->review->getScores()->getStory());
self::assertEquals(9, $this->review->getScores()->getArt());
self::assertEquals(10, $this->review->getScores()->getCharacter());
self::assertEquals(10, $this->review->getScores()->getEnjoyment());
self::assertEquals(0, $this->review->getReactions()->getLoveIt());
self::assertEquals(0, $this->review->getReactions()->getCreative());
self::assertEquals(0, $this->review->getReactions()->getWellWritten());
self::assertEquals(0, $this->review->getReactions()->getInformative());
self::assertEquals(0, $this->review->getReactions()->getConfusing());
self::assertEquals(0, $this->review->getReactions()->getFunny());
self::assertEquals(422, $this->review->getReactions()->getNice());
self::assertEquals(422, $this->review->getReactions()->getOverall());
}

/**
Expand All @@ -157,4 +151,4 @@ public function it_gets_reviewer_review(): void
}


}
}

0 comments on commit e2b6571

Please sign in to comment.