diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php index 36f3930fb2f..6b474750a0d 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php @@ -181,16 +181,10 @@ public function testIsTransient(): void $driver = $this->createMock(MappingDriver::class); $driver->expects(self::exactly(2)) ->method('isTransient') - ->withConsecutive( - [CmsUser::class], - [CmsArticle::class] - ) - ->willReturnMap( - [ - [CmsUser::class, true], - [CmsArticle::class, false], - ] - ); + ->willReturnMap([ + [CmsUser::class, true], + [CmsArticle::class, false], + ]); $em = $this->createEntityManager($driver); diff --git a/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php b/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php index a1bad8847dd..1c8b47ac0cf 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php @@ -6,6 +6,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Driver; +use Doctrine\DBAL\Result; use Doctrine\ORM\Decorator\EntityManagerDecorator; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Internal\Hydration\AbstractHydrator; @@ -64,17 +65,24 @@ public function testExtraParametersAreStrippedWhenWalkerRemovingOriginalSelectEl $query->setMaxResults(1); $paginator = (new Paginator($query, true))->setUseOutputWalkers(false); + $receivedParams = []; + $resultMock = $this->createMock(Result::class); $this->connection - ->expects(self::exactly(3)) ->method('executeQuery') - ->withConsecutive( - [self::anything(), [$paramInWhere]], - [self::anything(), [$paramInWhere]], - [self::anything(), [$paramInSubSelect, $paramInWhere, $returnedIds]] - ); + ->willReturnCallback(static function (string $sql, array $params) use (&$receivedParams, $resultMock): Result { + $receivedParams[] = $params; + + return $resultMock; + }); $paginator->count(); $paginator->getIterator(); + + self::assertSame([ + [$paramInWhere], + [$paramInWhere], + [$paramInSubSelect, $paramInWhere, $returnedIds], + ], $receivedParams); } public function testPaginatorNotCaringAboutExtraParametersWithoutOutputWalkers(): void