예제 #1
0
 public function testFindById()
 {
     $show = TV_Shows::findById($this->showId);
     $this->assertTrue($show);
     $this->assertTrue($show->seriesName == 'Battlestar Galactica (2003)');
     $this->assertTrue($show->id == $this->showId);
 }
예제 #2
0
 public function testGetSeason()
 {
     $show = TV_Shows::findById($this->showId);
     $season = $show->getSeason(2);
     foreach ($season as $episode) {
         $this->assertTrue((int) $episode->SeasonNumber == 2);
     }
 }
예제 #3
0
 public function testEpisodeNotFound()
 {
     $show = TV_Shows::findById($this->showId);
     $missingEpisode = $show->getEpisode(1, 99);
     //test for existing season, but not episode
     $this->assertFalse($missingEpisode, "Error fetching episode that doesn't exist from existing season");
     $missingSeason = $show->getEpisode(99, 1);
     //test for non-existing season and episode
     $this->assertFalse($missingSeason, "Error fetching episode for season that doesn't exist");
 }