/** * @expectedException Imbo\Exception\TransformationException * @expectedExceptionMessage error * @expectedExceptionCode 400 */ public function testThrowsCorrectExceptionWhenAnErrorOccurs() { $imagickException = new ImagickException('error'); $imagick = $this->getMock('Imagick'); $imagick->expects($this->once())->method('stripImage')->will($this->throwException($imagickException)); $transformation = new Strip(); $transformation->setImagick($imagick)->transform($this->getMock('Imbo\\EventManager\\Event')); }