public function testConvertBadLocationLink($input, $output, $locationId, $exception, $logType, $logMessage)
{
$inputDocument = new DOMDocument();
$inputDocument->loadXML($input);
$contentService = $this->getMockContentService();
$locationService = $this->getMockLocationService();
$urlAliasRouter = $this->getMockUrlAliasRouter();
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
$logger->expects($this->once())->method($logType)->with($this->equalTo($logMessage));
$locationService->expects($this->once())->method('loadLocation')->with($this->equalTo($locationId))->will($this->throwException($exception));
$converter = new Link($locationService, $contentService, $urlAliasRouter, $logger);
$outputDocument = $converter->convert($inputDocument);
$expectedOutputDocument = new DOMDocument();
$expectedOutputDocument->loadXML($output);
$this->assertEquals($expectedOutputDocument, $outputDocument);
}