make() public method

media 객체로 반환
public make ( File $file, array $addInfo = [] ) : Image
$file Xpressengine\Storage\File file instance
$addInfo array additional information
return Xpressengine\Media\Models\Image
Ejemplo n.º 1
0
 public function testMakeThrownExceptionWhenGivenFileIsNotAvailable()
 {
     list($storage) = $this->getMocks();
     $instance = new ImageHandler($storage);
     $mockFile = m::mock('Xpressengine\\Storage\\File');
     $mockFile->shouldReceive('getAttribute')->with('mime')->once()->andReturn('text/plain');
     try {
         $instance->make($mockFile);
         $this->assertTrue(false);
     } catch (\Exception $e) {
         $this->assertInstanceOf('Xpressengine\\Media\\Exceptions\\NotAvailableException', $e);
     }
 }