/** * @covers Imbo\Database\MongoDB::getImages * @expectedException Imbo\Exception\DatabaseException * @expectedExceptionMessage Unable to search for images * @expectedExceptionCode 500 */ public function testThrowsExceptionWhenMongoFailsDuringGetImages() { $this->imageCollection->expects($this->once())->method('find')->will($this->throwException(new MongoException())); $this->driver->getImages(['key'], $this->getMock('Imbo\\Resource\\Images\\Query'), $this->getMock('Imbo\\Model\\Images')); }