diff --git a/tests/Tests/ORM/Cache/Persister/Entity/EntityPersisterTestCase.php b/tests/Tests/ORM/Cache/Persister/Entity/EntityPersisterTestCase.php index dbb4788496d..c590f3a04e1 100644 --- a/tests/Tests/ORM/Cache/Persister/Entity/EntityPersisterTestCase.php +++ b/tests/Tests/ORM/Cache/Persister/Entity/EntityPersisterTestCase.php @@ -6,6 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Criteria; +use Doctrine\DBAL\LockMode; use Doctrine\ORM\Cache\Persister\CachedPersister; use Doctrine\ORM\Cache\Persister\Entity\AbstractEntityPersister; use Doctrine\ORM\Cache\Persister\Entity\CachedEntityPersister; @@ -97,7 +98,7 @@ public function testInvokeGetSelectSQL(): void ->with( self::identicalTo(['name' => 'Foo']), self::identicalTo($associationMapping), - self::identicalTo(1), + self::identicalTo(LockMode::OPTIMISTIC), self::identicalTo(2), self::identicalTo(3), self::identicalTo([4]), @@ -107,7 +108,7 @@ public function testInvokeGetSelectSQL(): void self::assertSame('SELECT * FROM foo WERE name = ?', $persister->getSelectSQL( ['name' => 'Foo'], $associationMapping, - 1, + LockMode::OPTIMISTIC, 2, 3, [4], @@ -233,13 +234,21 @@ public function testInvokeLoad(): void self::identicalTo($entity), self::identicalTo($associationMapping), self::identicalTo([1]), - self::identicalTo(2), + self::identicalTo(LockMode::PESSIMISTIC_READ), self::identicalTo(3), self::identicalTo([4]), ) ->willReturn($entity); - self::assertSame($entity, $persister->load(['id' => 1], $entity, $associationMapping, [1], 2, 3, [4])); + self::assertSame($entity, $persister->load( + ['id' => 1], + $entity, + $associationMapping, + [1], + LockMode::PESSIMISTIC_READ, + 3, + [4], + )); } public function testInvokeLoadAll(): void @@ -402,9 +411,9 @@ public function testInvokeLock(): void $this->entityPersister->expects(self::once()) ->method('lock') - ->with(self::identicalTo($identifier), self::identicalTo(1)); + ->with(self::identicalTo($identifier), self::identicalTo(LockMode::OPTIMISTIC)); - $persister->lock($identifier, 1); + $persister->lock($identifier, LockMode::OPTIMISTIC); } public function testInvokeExists(): void