@@ 19-32 (lines=14) @@ | ||
16 | ||
17 | class EpgSchedulerTest extends \PHPUnit_Framework_TestCase |
|
18 | { |
|
19 | public function testScheduleWithNoLastProgramAndNoVideos() |
|
20 | { |
|
21 | $startsAt = new \DateTime(); |
|
22 | $endsAt = new \DateTime('+30 seconds'); |
|
23 | ||
24 | $channel = $this->prophesizeChannel(); |
|
25 | $epgManager = $this->prophesizeEpgManager($channel); |
|
26 | $videoManager = $this->prophesizeVideoManager($channel); |
|
27 | ||
28 | $epgScheduler = new EpgScheduler($epgManager->reveal(), $videoManager->reveal()); |
|
29 | $epgScheduler->schedule($channel->reveal(), $startsAt, $endsAt); |
|
30 | } |
|
31 | ||
32 | public function testScheduleWithNoLastProgram() |
|
33 | { |
|
34 | $startsAt = new \DateTime(); |
|
35 | $videoDuration = 40; |
@@ 22-34 (lines=13) @@ | ||
19 | /** |
|
20 | * @expectedException UnexpectedValueException |
|
21 | */ |
|
22 | public function testScheduleFirstTimeButNoEpg() // no last media segment |
|
23 | { |
|
24 | $startsAt = new \DateTime(); |
|
25 | $endsAt = new \DateTime('+30 seconds'); |
|
26 | $channel = $this->prophesizeChannel(); |
|
27 | ||
28 | $parser = $this->prophesizeParser(); |
|
29 | $msManager = $this->prophesizeMediaSegmentManager(); |
|
30 | $epgManager = $this->prophesizeEpgManager(); |
|
31 | ||
32 | $scheduler = new PlaylistScheduler($parser->reveal(), $epgManager->reveal(), $msManager->reveal()); |
|
33 | $scheduler->schedule($channel->reveal(), $startsAt, $endsAt); |
|
34 | } |
|
35 | ||
36 | public function testSchedule() |
|
37 | { |