scratch – Blame information for rev 115
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
115 | office | 1 | <?php |
2 | |||
3 | namespace Tests\FFMpeg\Unit\Filters\Video; |
||
4 | |||
5 | use FFMpeg\Filters\Video\FrameRateFilter; |
||
6 | use Tests\FFMpeg\Unit\TestCase; |
||
7 | use FFMpeg\Coordinate\FrameRate; |
||
8 | |||
9 | class FrameRateFilterTest extends TestCase |
||
10 | { |
||
11 | public function testApplyWithAFormatThatSupportsBFrames() |
||
12 | { |
||
13 | $framerate = new FrameRate(54); |
||
14 | $gop = 42; |
||
15 | |||
16 | $video = $this->getVideoMock(); |
||
17 | $format = $this->getMock('FFMpeg\Format\VideoInterface'); |
||
18 | $format->expects($this->any()) |
||
19 | ->method('supportBFrames') |
||
20 | ->will($this->returnValue(true)); |
||
21 | |||
22 | $expected = array('-r', 54, '-b_strategy', '1', '-bf', '3', '-g', 42); |
||
23 | |||
24 | $filter = new FrameRateFilter($framerate, $gop); |
||
25 | $this->assertEquals($expected, $filter->apply($video, $format)); |
||
26 | } |
||
27 | |||
28 | public function testApplyWithAFormatThatDoesNotSupportsBFrames() |
||
29 | { |
||
30 | $framerate = new FrameRate(54); |
||
31 | $gop = 42; |
||
32 | |||
33 | $video = $this->getVideoMock(); |
||
34 | $format = $this->getMock('FFMpeg\Format\VideoInterface'); |
||
35 | $format->expects($this->any()) |
||
36 | ->method('supportBFrames') |
||
37 | ->will($this->returnValue(false)); |
||
38 | |||
39 | $expected = array('-r', 54); |
||
40 | |||
41 | $filter = new FrameRateFilter($framerate, $gop); |
||
42 | $this->assertEquals($expected, $filter->apply($video, $format)); |
||
43 | } |
||
44 | } |