미디어에서 사진 추출
public getPicture ( |
||
$media | media instance | |
return | null | string | 이미지 content |
public function testGetPicture() { list($storage, $reader, $temp, $extension, $fromSecond) = $this->getMocks(); $instance = new VideoHandler($storage, $reader, $temp, $extension, $fromSecond); $mockVideo = m::mock('Xpressengine\\Media\\Models\\Video'); $mockVideo->shouldReceive('getContent')->andReturn('content'); $extension->shouldReceive('getSnapshot')->once()->with('content', $fromSecond)->andReturn('snapshot content'); $instance->getPicture($mockVideo); }
public function testGetPicture() { list($storage, $repo, $reader, $temp, $extension) = $this->getMocks(); $instance = new VideoHandler($storage, $repo, $reader, $temp, $extension); $mockFile = m::mock('Xpressengine\\Storage\\File'); $mockFile->shouldReceive('getPath')->andReturn('/some/dir/path'); $mockFile->shouldReceive('getOriginId')->andReturn('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'); $mockVideo = m::mock('Xpressengine\\Media\\Spec\\Video'); $mockVideo->shouldReceive('getFile')->andReturn($mockFile); $storage->shouldReceive('read')->once()->with($mockFile)->andReturn('content string'); $extension->shouldReceive('getSnapshot')->once()->with('content string')->andReturn('snapshot content'); $instance->getPicture($mockVideo); }