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 testRemove() { list($storage, $repo, $reader, $temp, $extension) = $this->getMocks(); $instance = new VideoHandler($storage, $repo, $reader, $temp, $extension); $mockMedia = m::mock('Xpressengine\\Media\\Spec\\Media'); $mockMeta = m::mock('Xpressengine\\Media\\Meta'); $mockMedia->shouldReceive('getMeta')->andReturn($mockMeta); $repo->shouldReceive('delete')->once()->with($mockMeta); $instance->remove($mockMedia); }