Imbo\EventListener\AutoRotateImage::autoRotate PHP Метод

autoRotate() публичный Метод

Autorotate images when new images are added to Imbo
public autoRotate ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The triggered event
    public function autoRotate(EventInterface $event)
    {
        $event->getManager()->trigger('image.transformation.autorotate', ['image' => $event->getRequest()->getImage()]);
    }

Usage Example

Пример #1
0
 /**
  * @covers Imbo\EventListener\AutoRotateImage::autoRotate
  */
 public function testTriggersAnEventForRotatingTheImage()
 {
     $image = $this->getMock('Imbo\\Model\\Image');
     $request = $this->getMock('Imbo\\Http\\Request\\Request');
     $request->expects($this->once())->method('getImage')->will($this->returnValue($image));
     $eventManager = $this->getMock('Imbo\\EventManager\\EventManager');
     $eventManager->expects($this->once())->method('trigger')->with('image.transformation.autorotate', array('image' => $image));
     $event = $this->getMock('Imbo\\EventManager\\Event');
     $event->expects($this->once())->method('getRequest')->will($this->returnValue($request));
     $event->expects($this->once())->method('getManager')->will($this->returnValue($eventManager));
     $this->listener->autoRotate($event);
 }