Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TV Episode: add missing property runtime #273

Open
wants to merge 1 commit into
base: 4.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion lib/Tmdb/Model/Tv/Episode.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class Episode extends AbstractModel
'still_path',
'vote_average',
'vote_count',
'show_id'
'show_id',
'runtime',
];
/**
* Credits
Expand Down Expand Up @@ -144,6 +145,10 @@ class Episode extends AbstractModel
* @var integer
*/
private $showId;
/**
* @var int
*/
private $runtime;

/**
* Constructor
Expand Down Expand Up @@ -505,4 +510,20 @@ public function setShowId(int $showId): Episode

return $this;
}

/**
* @return int
*/
public function getRuntime(): int
{
return $this->runtime;
}

/**
* @param int $runtime
*/
public function setRuntime(int $runtime): void
{
$this->runtime = $runtime;
}
}
15 changes: 8 additions & 7 deletions test/Tmdb/Tests/Factory/TvEpisodeFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function setUp(): void
* @var TvEpisodeFactory $factory
*/
$factory = $this->getFactory();
$data = $this->loadByFile('tv/season/episode/all.json');
$data = $this->loadByFile('tv/season/episode/all.json');

/**
* @var Episode $episode
Expand Down Expand Up @@ -82,13 +82,14 @@ 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('Walt and Jesse are vividly reminded of Tuco’s volatile nature, and try to figure a way out of their business partnership. Hank attempts to mend fences between the estranged Marie and Skyler.', $this->episode->getOverview());
$this->assertEquals(972873, $this->episode->getId());
$this->assertEquals("", $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());
$this->assertEquals('/7vVujNqjP23MtPqUTBNITIW3DDA.jpg', $this->episode->getStillPath());
$this->assertEquals(8.272, $this->episode->getVoteAverage());
$this->assertEquals(125, $this->episode->getVoteCount());
$this->assertEquals(48, $this->episode->getRuntime());
}

protected function getFactoryClass()
Expand Down
Loading