Skip to content

Commit 1b08114

Browse files
authored
Merge pull request #273 from ihsudg/episode-add-run-time
TV Episode: add missing property runtime
2 parents dd773b8 + fc7fc05 commit 1b08114

File tree

3 files changed

+175
-561
lines changed

3 files changed

+175
-561
lines changed

lib/Tmdb/Model/Tv/Episode.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class Episode extends AbstractModel
5050
'still_path',
5151
'vote_average',
5252
'vote_count',
53-
'show_id'
53+
'show_id',
54+
'runtime',
5455
];
5556
/**
5657
* Credits
@@ -144,6 +145,10 @@ class Episode extends AbstractModel
144145
* @var integer
145146
*/
146147
private $showId;
148+
/**
149+
* @var int
150+
*/
151+
private $runtime;
147152

148153
/**
149154
* Constructor
@@ -505,4 +510,20 @@ public function setShowId(int $showId): Episode
505510

506511
return $this;
507512
}
513+
514+
/**
515+
* @return int
516+
*/
517+
public function getRuntime(): int
518+
{
519+
return $this->runtime;
520+
}
521+
522+
/**
523+
* @param int $runtime
524+
*/
525+
public function setRuntime(int $runtime): void
526+
{
527+
$this->runtime = $runtime;
528+
}
508529
}

test/Tmdb/Tests/Factory/TvEpisodeFactoryTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function setUp(): void
3030
* @var TvEpisodeFactory $factory
3131
*/
3232
$factory = $this->getFactory();
33-
$data = $this->loadByFile('tv/season/episode/all.json');
33+
$data = $this->loadByFile('tv/season/episode/all.json');
3434

3535
/**
3636
* @var Episode $episode
@@ -82,13 +82,14 @@ public function shouldBeFunctional()
8282
$this->assertEquals(new \DateTime('2009-03-08'), $this->episode->getAirDate());
8383
$this->assertEquals(1, $this->episode->getEpisodeNumber());
8484
$this->assertEquals('Seven Thirty-Seven', $this->episode->getName());
85-
$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());
86-
$this->assertEquals(62092, $this->episode->getId());
87-
$this->assertEquals(null, $this->episode->getProductionCode());
85+
$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());
86+
$this->assertEquals(972873, $this->episode->getId());
87+
$this->assertEquals("", $this->episode->getProductionCode());
8888
$this->assertEquals(2, $this->episode->getSeasonNumber());
89-
$this->assertEquals('/bwgioLAgihPCUK21rLWocDaDM3g.jpg', $this->episode->getStillPath());
90-
$this->assertEquals(0, $this->episode->getVoteAverage());
91-
$this->assertEquals(0, $this->episode->getVoteCount());
89+
$this->assertEquals('/7vVujNqjP23MtPqUTBNITIW3DDA.jpg', $this->episode->getStillPath());
90+
$this->assertEquals(8.272, $this->episode->getVoteAverage());
91+
$this->assertEquals(125, $this->episode->getVoteCount());
92+
$this->assertEquals(48, $this->episode->getRuntime());
9293
}
9394

9495
protected function getFactoryClass()

0 commit comments

Comments
 (0)