From 9c630c9c616528840ef5888805736ca84b9f6282 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Sat, 8 Feb 2014 15:49:49 +0100 Subject: [PATCH] TvSeason coverage --- test/Tmdb/Tests/Factory/TvSeasonFactoryTest.php | 13 +++++++++++++ test/Tmdb/Tests/Model/Tv/SeasonTest.php | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/test/Tmdb/Tests/Factory/TvSeasonFactoryTest.php b/test/Tmdb/Tests/Factory/TvSeasonFactoryTest.php index 4e810cc7..80140296 100644 --- a/test/Tmdb/Tests/Factory/TvSeasonFactoryTest.php +++ b/test/Tmdb/Tests/Factory/TvSeasonFactoryTest.php @@ -75,6 +75,19 @@ public function shouldBeAbleToSetFactories() $this->assertInstanceOf('stdClass', $factory->getTvEpisodeFactory()); } + /** + * @test + */ + public function shouldBeFunctional() + { + $this->assertEquals(new \DateTime('2009-03-08'), $this->season->getAirDate()); + $this->assertEquals('Season 2', $this->season->getName()); + $this->assertEquals('The second season of the American television drama series Breaking Bad premiered on March 8, 2009 and concluded on May 31, 2009. It consisted of 13 episodes, each running approximately 47 minutes in length. AMC broadcast the second season on Sundays at 10:00 pm in the United States. The complete second season was released on Region 1 DVD and Region A Blu-ray on March 16, 2010.', $this->season->getOverview()); + $this->assertEquals(3573, $this->season->getId()); + $this->assertEquals('/rCdISteF1GPvPsy0a5L0LDffjtP.jpg', $this->season->getPosterPath()); + $this->assertEquals(2, $this->season->getSeasonNumber()); + } + protected function getFactoryClass() { return 'Tmdb\Factory\TvSeasonFactory'; diff --git a/test/Tmdb/Tests/Model/Tv/SeasonTest.php b/test/Tmdb/Tests/Model/Tv/SeasonTest.php index 6863b9d1..0e5b87ea 100644 --- a/test/Tmdb/Tests/Model/Tv/SeasonTest.php +++ b/test/Tmdb/Tests/Model/Tv/SeasonTest.php @@ -34,4 +34,18 @@ public function shouldConstructTvSeason() ) ); } + + /** + * @test + */ + public function shouldBeAbleToOverrideDefaultCollections() + { + $season = new Season(); + + $class = new \stdClass(); + + $season->setCredits($class); + + $this->assertInstanceOf('stdClass', $season->getCredits()); + } }