mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Remove some exists checks by not validating
This commit is contained in:
parent
51bd1d0a2b
commit
838d23300b
2 changed files with 2 additions and 17 deletions
|
@ -119,9 +119,9 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
||||||
$record[$this->_model->primaryKey] = $id;
|
$record[$this->_model->primaryKey] = $id;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return $this->_model->save($record);
|
return $this->_model->save($record, array('validate' => false));
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
return $this->_model->save($record);
|
return $this->_model->save($record, array('validate' => false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -213,31 +213,16 @@ class DatabaseSessionTest extends CakeTestCase {
|
||||||
->method('exists')
|
->method('exists')
|
||||||
->will($this->returnValue(false));
|
->will($this->returnValue(false));
|
||||||
|
|
||||||
// First validate
|
|
||||||
$mockedModel->expects($this->at($counter++))
|
|
||||||
->method('exists')
|
|
||||||
->will($this->returnValue(false));
|
|
||||||
|
|
||||||
// Second save
|
// Second save
|
||||||
$mockedModel->expects($this->at($counter++))
|
$mockedModel->expects($this->at($counter++))
|
||||||
->method('exists')
|
->method('exists')
|
||||||
->will($this->returnValue(false));
|
->will($this->returnValue(false));
|
||||||
|
|
||||||
// Second validate
|
|
||||||
$mockedModel->expects($this->at($counter++))
|
|
||||||
->method('exists')
|
|
||||||
->will($this->returnValue(false));
|
|
||||||
|
|
||||||
// Second save retry
|
// Second save retry
|
||||||
$mockedModel->expects($this->at($counter++))
|
$mockedModel->expects($this->at($counter++))
|
||||||
->method('exists')
|
->method('exists')
|
||||||
->will($this->returnValue(true));
|
->will($this->returnValue(true));
|
||||||
|
|
||||||
// Second validate retry
|
|
||||||
$mockedModel->expects($this->at($counter++))
|
|
||||||
->method('exists')
|
|
||||||
->will($this->returnValue(false));
|
|
||||||
|
|
||||||
// Datasource exists check
|
// Datasource exists check
|
||||||
$mockedModel->expects($this->at($counter++))
|
$mockedModel->expects($this->at($counter++))
|
||||||
->method('exists')
|
->method('exists')
|
||||||
|
|
Loading…
Reference in a new issue