Add unit tests for nested transaction support

This commit is contained in:
Kijin Sung 2023-04-30 22:53:22 +09:00
parent 7755821f20
commit be97b3f5e5

View file

@ -99,6 +99,20 @@ class DBTest extends \Codeception\TestCase\Test
$this->assertTrue($stmt->closeCursor());
}
public function testTransaction()
{
$oDB = Rhymix\Framework\DB::getInstance();
$this->assertEquals(0, $oDB->getTransactionLevel());
$this->assertEquals(1, $oDB->beginTransaction());
$this->assertEquals(1, $oDB->getTransactionLevel());
$this->assertEquals(2, $oDB->begin());
$this->assertEquals(2, $oDB->getTransactionLevel());
$this->assertEquals(1, $oDB->rollback());
$this->assertEquals(1, $oDB->getTransactionLevel());
$this->assertEquals(0, $oDB->commit());
$this->assertEquals(0, $oDB->getTransactionLevel());
}
public function testAddPrefixes()
{
$oDB = Rhymix\Framework\DB::getInstance();