mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Removing some dup code in nested transaction tests.
This commit is contained in:
parent
7be5349b0c
commit
37157806b9
1 changed files with 12 additions and 12 deletions
|
@ -865,12 +865,7 @@ class DboSourceTest extends CakeTestCase {
|
|||
$conn->expects($this->at(4))->method('exec')->with($this->equalTo('ROLLBACK TO SAVEPOINT LEVEL1'))->will($this->returnValue(true));
|
||||
$conn->expects($this->at(5))->method('commit')->will($this->returnValue(true));
|
||||
|
||||
$db->begin();
|
||||
$db->begin();
|
||||
$db->commit();
|
||||
$db->begin();
|
||||
$db->rollback();
|
||||
$db->commit();
|
||||
$this->_runTransactions($db);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -889,12 +884,7 @@ class DboSourceTest extends CakeTestCase {
|
|||
$conn->expects($this->never())->method('exec');
|
||||
$conn->expects($this->once())->method('commit')->will($this->returnValue(true));
|
||||
|
||||
$db->begin();
|
||||
$db->begin();
|
||||
$db->commit();
|
||||
$db->begin();
|
||||
$db->rollback();
|
||||
$db->commit();
|
||||
$this->_runTransactions($db);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -912,6 +902,16 @@ class DboSourceTest extends CakeTestCase {
|
|||
$conn->expects($this->never())->method('exec');
|
||||
$conn->expects($this->once())->method('commit')->will($this->returnValue(true));
|
||||
|
||||
$this->_runTransactions($db);
|
||||
}
|
||||
|
||||
/**
|
||||
* Nested transaction calls
|
||||
*
|
||||
* @param DboTestSource $db
|
||||
* @return void
|
||||
*/
|
||||
protected function _runTransactions($db) {
|
||||
$db->begin();
|
||||
$db->begin();
|
||||
$db->commit();
|
||||
|
|
Loading…
Reference in a new issue