public function testRowUniqueReplaceOrDeleteShouldThrowExceptionWhenPermissionDenied()
{
$row = 1;
$historyId = 2;
$settings = array('user' => 1, 'map' => array('field1' => 'field1', 'field2' => 'field2'), 'type' => 'TypeExists', 'unique' => array('field1' => 1, 'field2' => 0), 'history' => $historyId);
$data = array('settings1' => 'value1', 'settings2' => 'value2');
$fields = array_combine($settings['map'], $data);
$mockEntry = $this->getMockEntry();
$mockCriteria = $this->getMockCriteria();
$mockCriteria->expects($this->exactly(1))->method('count')->willReturn(1);
$mockImportEntryService = $this->setMockImportEntryService($settings, $mockEntry, $fields);
$mockImportEntryService->expects($this->exactly(1))->method('setCriteria')->with($settings)->willReturn($mockCriteria);
$this->setMockImportHistoryService($historyId, $row, $this->isType('array'));
$mockUser = $this->getMockUser();
$this->setMockUsersService($mockUser);
$service = new ImportService();
$service->row($row, $data, $settings);
}