/** * @covers Imbo\Database\MongoDB::getImageMimeType * @expectedException Imbo\Exception\DatabaseException * @expectedExceptionMessage Unable to fetch image meta data * @expectedExceptionCode 500 */ public function testThrowsExceptionWhenMongoFailsDuringGetImageMimeType() { $this->imageCollection->expects($this->once())->method('findOne')->will($this->throwException(new MongoException())); $this->driver->getImageMimeType('key', 'identifier'); }