public function testStoreFieldDataThrowsNotFoundException($xmlString, $linkUrls, $linkIds, $insertLinks, $remoteIds, $contentIds)
{
$gateway = $this->getGatewayMock();
$gateway->expects($this->once())->method('getUrlIdMap')->with($this->equalTo($linkUrls))->will($this->returnValue($linkIds));
$gateway->expects($this->once())->method('getContentIds')->with($this->equalTo($remoteIds))->will($this->returnValue($contentIds));
$gateway->expects($this->never())->method('getIdUrlMap');
if (empty($insertLinks)) {
$gateway->expects($this->never())->method('insertUrl');
}
foreach ($insertLinks as $index => $linkMap) {
$gateway->expects($this->at($index + 2))->method('insertUrl')->with($this->equalTo($linkMap['url']))->will($this->returnValue($linkMap['id']));
}
$versionInfo = new VersionInfo();
$value = new FieldValue(array('data' => $xmlString));
$field = new Field(array('value' => $value));
$storage = $this->getPartlyMockedStorage(array('getGateway'));
$storage->expects($this->once())->method('getGateway')->with($this->getContext())->will($this->returnValue($gateway));
$storage->storeFieldData($versionInfo, $field, $this->getContext());
}