You are here

protected function RedirectRequestSubscriberTest::getPostResponseEvent in Redirect 8

Gets post response event.

Parameters

array $headers: Headers to be set into the response.

Return value

\Symfony\Component\HttpKernel\Event\PostResponseEvent The post response event object.

File

tests/src/Unit/RedirectRequestSubscriberTest.php, line 258

Class

RedirectRequestSubscriberTest
Tests the redirect logic.

Namespace

Drupal\Tests\redirect\Unit

Code

protected function getPostResponseEvent($headers = []) {
  $http_kernel = $this
    ->getMockBuilder('\\Symfony\\Component\\HttpKernel\\HttpKernelInterface')
    ->getMock();
  $request = $this
    ->getMockBuilder('Symfony\\Component\\HttpFoundation\\Request')
    ->disableOriginalConstructor()
    ->getMock();
  $response = new Response('', 301, $headers);
  return new PostResponseEvent($http_kernel, $request, $response);
}