/** * @test */ public function shouldBeFunctional() { $this->assertEquals(new \DateTime('2009-03-08'), $this->episode->getAirDate()); $this->assertEquals(1, $this->episode->getEpisodeNumber()); $this->assertEquals('Seven Thirty-Seven', $this->episode->getName()); $this->assertEquals('Walt and Jesse try to figure a way out of their partnership with Tuco. Hank tries to mend the fences between Marie and Skyler.', $this->episode->getOverview()); $this->assertEquals(62092, $this->episode->getId()); $this->assertEquals(null, $this->episode->getProductionCode()); $this->assertEquals(2, $this->episode->getSeasonNumber()); $this->assertEquals('/bwgioLAgihPCUK21rLWocDaDM3g.jpg', $this->episode->getStillPath()); $this->assertEquals(0, $this->episode->getVoteAverage()); $this->assertEquals(0, $this->episode->getVoteCount()); }
/** * @param FixtureEpisodeData $f * @param Tv\Episode $e * @param Tv $s */ private function writeLookupSuccessEpisode(FixtureEpisodeData $f, Tv\Episode $e, Tv $s) { try { $fileSize = $f->getFile()->getSizeHuman(); } catch (\RuntimeException $e) { $fileSize = 'UNKNOWN'; $this->io()->warning(sprintf('An error occured while retrieving the file size for %s', $f->getFile()->getPathname())); } $country = ''; $countrySet = $s->getOriginCountry(); if ($countrySet->count() > 0) { $countryKey = $countrySet->getKeys()[0]; $country = $countrySet->get($countryKey)->getIso31661(); } $rows = [['Tvdb Id', $s->getId() . '/' . $e->getId()], ['File Path', $f->getFile()->getPathname()], ['Show Name', $s->getName()], ['Season', $e->getSeasonNumber()], ['Episode Number', $e->getEpisodeNumber()], ['Episode Title', $e->getName()], ['Origin Country', $country], ['Air Date', $e->getAirDate()->format('Y\\-m\\-d')], ['Size', $fileSize], ['API Match', sprintf('<fg=green>OKAY: %d/%d</>', $s->getId(), $e->getId())]]; $this->ioVerbose(function (StyleInterface $style) use($rows) { $style->table($rows, []); }); $rows = [['File Path', $f->getFile()->getPathname()], ['Show Name', $s->getName()], ['Season/Episode', sprintf('%d/%d', $e->getSeasonNumber(), $e->getEpisodeNumber())], ['Episode Title', $e->getName()], ['Size', $fileSize], ['API Match', sprintf('<fg=green>OKAY: %d/%d</>', $s->getId(), $e->getId())]]; $this->ioNotVerbose(function (StyleInterface $style) use($rows) { $style->table($rows, []); }); }