diff --git a/lib/Adapter/Doctrine/MongoDBODM/Tests/AggregationAdapterTest.php b/lib/Adapter/Doctrine/MongoDBODM/Tests/AggregationAdapterTest.php index 2095e301..b310e6d5 100644 --- a/lib/Adapter/Doctrine/MongoDBODM/Tests/AggregationAdapterTest.php +++ b/lib/Adapter/Doctrine/MongoDBODM/Tests/AggregationAdapterTest.php @@ -5,6 +5,7 @@ use Doctrine\ODM\MongoDB\Aggregation\Aggregation; use Doctrine\ODM\MongoDB\Aggregation\Builder; use Doctrine\ODM\MongoDB\Aggregation\Stage\Count; +use Doctrine\ODM\MongoDB\Aggregation\Stage\Limit; use Doctrine\ODM\MongoDB\Aggregation\Stage\Skip; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ODM\MongoDB\Iterator\Iterator; @@ -88,12 +89,15 @@ public function testGetSlice(): void /** @var MockObject&Skip $skipStage */ $skipStage = $this->createMock(Skip::class); + /** @var MockObject&Limit $limitStage */ + $limitStage = $this->createMock(Limit::class); + $skipStage->expects(self::once()) ->method('limit') ->with($length) - ->willReturn($this->aggregationBuilder); + ->willReturn($limitStage); - $this->aggregationBuilder->expects(self::once()) + $limitStage->expects(self::once()) ->method('getAggregation') ->willReturn($aggregation);