Inject Video at Frame construction
This commit is contained in:
parent
f530d60118
commit
5814eb3085
4 changed files with 29 additions and 9 deletions
|
|
@ -20,7 +20,7 @@ class FrameTest extends AbstractMediaTestCase
|
|||
$ffprobe = $this->getFFProbeMock();
|
||||
$timecode = $this->getTimeCodeMock();
|
||||
|
||||
$frame = new Frame(__FILE__, $driver, $ffprobe, $timecode);
|
||||
$frame = new Frame($this->getVideoMock(__FILE__), $driver, $ffprobe, $timecode);
|
||||
$this->assertSame($timecode, $frame->getTimeCode());
|
||||
}
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ class FrameTest extends AbstractMediaTestCase
|
|||
$ffprobe = $this->getFFProbeMock();
|
||||
$timecode = $this->getTimeCodeMock();
|
||||
|
||||
$frame = new Frame(__FILE__, $driver, $ffprobe, $timecode);
|
||||
$frame = new Frame($this->getVideoMock(__FILE__), $driver, $ffprobe, $timecode);
|
||||
$this->assertInstanceOf('FFMpeg\Filters\Frame\FrameFilters', $frame->filters());
|
||||
}
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ class FrameTest extends AbstractMediaTestCase
|
|||
->method('add')
|
||||
->with($filter);
|
||||
|
||||
$frame = new Frame(__FILE__, $driver, $ffprobe, $timecode);
|
||||
$frame = new Frame($this->getVideoMock(__FILE__), $driver, $ffprobe, $timecode);
|
||||
$frame->setFiltersCollection($filters);
|
||||
$frame->addFilter($filter);
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ class FrameTest extends AbstractMediaTestCase
|
|||
->method('command')
|
||||
->with($commands);
|
||||
|
||||
$frame = new Frame(__FILE__, $driver, $ffprobe, $timecode);
|
||||
$frame = new Frame($this->getVideoMock(__FILE__), $driver, $ffprobe, $timecode);
|
||||
$this->assertSame($frame, $frame->save($pathfile, $accurate));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,10 +122,16 @@ class TestCase extends \PHPUnit_Framework_TestCase
|
|||
->getMock();
|
||||
}
|
||||
|
||||
protected function getVideoMock()
|
||||
protected function getVideoMock($filename = null)
|
||||
{
|
||||
return $this->getMockBuilder('FFMpeg\Media\Video')
|
||||
$video = $this->getMockBuilder('FFMpeg\Media\Video')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$video->expects($this->any())
|
||||
->method('getFilename')
|
||||
->will($this->returnValue($filename));
|
||||
|
||||
return $video;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue