Author: XE Team (developers) (developers@xpressengine.com)
Inheritance: extends AbstractHandler
 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);
     }
 }
 public function testRemove()
 {
     list($storage, $repo) = $this->getMocks();
     $instance = new ImageHandler($storage, $repo);
     $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);
 }