Skip to content

Commit

Permalink
test nesting level reseting
Browse files Browse the repository at this point in the history
  • Loading branch information
k.kalinin committed Sep 20, 2019
1 parent 9fa3ac0 commit 74ad9d6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ public function testTransactionNestingBehavior() : void
self::assertEquals(0, $this->connection->getTransactionNestingLevel());
}
}

public function testTransactionNestingLevelIsResetOnReconnect(): void
{
$this->connection->beginTransaction();
$this->connection->beginTransaction();
self::assertEquals(2, $this->connection->getTransactionNestingLevel());
$this->connection->close(); // connection is lost
$this->connection->beginTransaction(); // should connect, reset nesting level and increase it once
self::assertEquals(1, $this->connection->getTransactionNestingLevel());
$this->connection->commit();
self::assertEquals(0, $this->connection->getTransactionNestingLevel());
}

public function testTransactionNestingBehaviorWithSavepoints() : void
{
Expand Down

0 comments on commit 74ad9d6

Please sign in to comment.