Example #1
0
 /**
  * Test successfull nested transaction
  */
 public function testNestedTransactionLastRollBack()
 {
     $this->_adapter->expects($this->exactly(2))->method('_connect');
     $this->_adapter->expects($this->once())->method('_beginTransaction');
     $this->_adapter->expects($this->once())->method('_rollBack');
     $this->_adapter->beginTransaction();
     $this->_adapter->beginTransaction();
     $this->_adapter->beginTransaction();
     $this->assertEquals(3, $this->_adapter->getTransactionLevel());
     $this->_adapter->commit();
     $this->_adapter->commit();
     $this->_adapter->rollBack();
     $this->assertEquals(0, $this->_adapter->getTransactionLevel());
 }
Example #2
0
 /**
  * Adjust transaction level with "transparent" counter
  *
  * @return int
  */
 public function getTransactionLevel()
 {
     return parent::getTransactionLevel() - $this->_levelAdjustment;
 }