Permalink
Browse files

Remove some exists checks by not validating

  • Loading branch information...
AD7six committed Jan 23, 2015
1 parent 51bd1d0 commit 838d23300b03df066adb80462a95b4239947da09
@@ -119,9 +119,9 @@ public function write($id, $data) {
$record[$this->_model->primaryKey] = $id;
try {
return $this->_model->save($record);
return $this->_model->save($record, array('validate' => false));
} catch (PDOException $e) {
return $this->_model->save($record);
return $this->_model->save($record, array('validate' => false));
}
}
@@ -213,31 +213,16 @@ public function testConcurrentInsert() {
->method('exists')
->will($this->returnValue(false));
// First validate
$mockedModel->expects($this->at($counter++))
->method('exists')
->will($this->returnValue(false));
// Second save
$mockedModel->expects($this->at($counter++))
->method('exists')
->will($this->returnValue(false));
// Second validate
$mockedModel->expects($this->at($counter++))
->method('exists')
->will($this->returnValue(false));
// Second save retry
$mockedModel->expects($this->at($counter++))
->method('exists')
->will($this->returnValue(true));
// Second validate retry
$mockedModel->expects($this->at($counter++))
->method('exists')
->will($this->returnValue(false));
// Datasource exists check
$mockedModel->expects($this->at($counter++))
->method('exists')

0 comments on commit 838d233

Please sign in to comment.