prepareImage() public method

This method should prepare an image object from php://input. The method must also figure out the width, height, mime type and extension of the image.
public prepareImage ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The current event
Beispiel #1
0
 /**
  * @covers Imbo\Image\ImagePreparation::prepareImage
  * @covers Imbo\Image\ImagePreparation::generateImageIdentifier
  */
 public function testDoesNotInstantiateCallableGenerator()
 {
     $imagePath = FIXTURES_DIR . '/image.png';
     $imageData = file_get_contents($imagePath);
     $config['imageIdentifierGenerator'] = new CallableImageIdentifierGenerator();
     $event = $this->getMock('Imbo\\EventManager\\Event');
     $event->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
     $event->expects($this->any())->method('getResponse')->will($this->returnValue($this->response));
     $event->expects($this->any())->method('getConfig')->will($this->returnValue($config));
     $event->expects($this->any())->method('getDatabase')->will($this->returnValue($this->database));
     $this->request->expects($this->once())->method('getContent')->will($this->returnValue($imageData));
     $this->request->expects($this->once())->method('setImage')->with($this->isInstanceOf('Imbo\\Model\\Image'));
     $this->prepare->prepareImage($event);
 }