Skip to content

EspoCRM – Open Source CRM Application

Test change

Yuriib0a38c27d1ec
diff --git a/tests/unit/Espo/ORM/TransactionManagerTest.php b/tests/unit/Espo/ORM/TransactionManagerTest.php
index 10b77539eb..6d659fa050 100644
--- a/tests/unit/Espo/ORM/TransactionManagerTest.php
+++ b/tests/unit/Espo/ORM/TransactionManagerTest.php
@@ -278,13 +278,20 @@ class TransactionManagerTest extends TestCase
public function testDeadlock(): void
{
+ $expectedCount = 4;
+
$this->pdo
- ->expects($this->exactly(4))
+ ->expects($this->exactly($expectedCount))
->method('beginTransaction');
+ $this->pdo
+ ->expects($this->exactly($expectedCount))
+ ->method('inTransaction')
+ ->willReturn(false);
+
$this->pdo
->expects($this->never())
- ->method('rollback');
+ ->method('rollBack');
$counter = 0;
$thrown = false;
@@ -300,6 +307,6 @@ class TransactionManagerTest extends TestCase
}
$this->assertTrue($thrown);
- $this->assertEquals(4, $counter);
+ $this->assertEquals($expectedCount, $counter);
}
}