diff --git a/core-bundle/tests/Crawl/Escargot/Subscriber/SearchIndexSubscriberTest.php b/core-bundle/tests/Crawl/Escargot/Subscriber/SearchIndexSubscriberTest.php index 945b98563c5..6018b02159a 100644 --- a/core-bundle/tests/Crawl/Escargot/Subscriber/SearchIndexSubscriberTest.php +++ b/core-bundle/tests/Crawl/Escargot/Subscriber/SearchIndexSubscriberTest.php @@ -472,8 +472,20 @@ private function getResponse(bool $asHtml, int $statusCode = 200): ResponseInter $response ->method('getInfo') - ->with('response_headers') - ->willReturn([]) + ->willReturnCallback( + static function (string $key) use ($statusCode) { + switch ($key) { + case 'http_code': + return $statusCode; + + case 'response_headers': + return []; + + default: + return null; + } + } + ) ; return $response;