/** * @vcr bierdopje.yml */ public function test_it_fetches_shows_by_linkName() { $show = $this->api->getShowByName('las-vegas', true); $this->assertEquals($show->id, 5202); $this->assertEquals($show->tvdbId, 72229); $this->assertEquals($show->name, "Las Vegas"); $this->assertEquals($show->firstAired->format('d-m-Y'), '22-09-2003'); $this->assertEquals($show->lastAired->format('d-m-Y'), '15-02-2008'); #$this->assertEquals($show->nextEpisode->format('d-m-Y'), '27-01-2016'); $this->assertTrue($show->seasons == 5, 'There are 5 seasons'); $this->assertTrue($show->episodes >= 93, 'There are 111 or more episodes'); $this->assertTrue(in_array('Adventure', $show->genres), 'Genres contains "Adventure"'); $this->assertTrue(strlen($show->summary) > 100, 'The summary has more than 100 chars'); }
public function getShowByLinkName($linkName) { $show = $this->api->getShowByName($linkName, true); $show = $this->formatShow($show); return JsonResponse::create($show); }