Skip to content

Commit

Permalink
Merge pull request #273 from ihsudg/episode-add-run-time
Browse files Browse the repository at this point in the history
TV Episode: add missing property runtime
  • Loading branch information
wtfzdotnet authored Dec 27, 2024
2 parents dd773b8 + fc7fc05 commit 1b08114
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 561 deletions.
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

0 comments on commit 1b08114

Please sign in to comment.