Skip to content

Commit

Permalink
Fix the search index subscriber test (see #2000)
Browse files Browse the repository at this point in the history
Description
-----------

See #1991 (comment). Needs to be backported to Contao 4.9.

Commits
-------

d43d6a4 Fix the search index subscriber test
  • Loading branch information
leofeyer committed Jul 26, 2020
1 parent 96874e8 commit 50a5988
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 50a5988

Please sign in to comment.