Skip to content
Snippets Groups Projects
Commit c48a2ac2 authored by mondrake's avatar mondrake
Browse files

Update file RedirectResponseSubscriberTest.php

parent 81c3e434
No related branches found
No related tags found
No related merge requests found
Pipeline #107164 failed
Pipeline: drupal-3419693

#107169

    ......@@ -9,7 +9,6 @@
    use Drupal\Core\Routing\TrustedRedirectResponse;
    use Drupal\Core\Utility\UnroutedUrlAssemblerInterface;
    use Drupal\Tests\UnitTestCase;
    use Psr\Log\LoggerInterface;
    use Symfony\Component\DependencyInjection\Container;
    use Symfony\Component\HttpFoundation\RedirectResponse;
    use Symfony\Component\HttpFoundation\Request;
    ......@@ -83,7 +82,7 @@ public function testDestinationRedirect(Request $request, $expected) {
    $response = new RedirectResponse('http://example.com/drupal');
    $request->headers->set('HOST', 'example.com');
    $listener = new RedirectResponseSubscriber($this->urlAssembler, $this->requestContext, $this->prophesize(LoggerInterface::class)->reveal());
    $listener = new RedirectResponseSubscriber($this->urlAssembler, $this->requestContext, $this->prophesize(\Closure::class)->reveal());
    $dispatcher->addListener(KernelEvents::RESPONSE, [$listener, 'checkRedirectUrl']);
    $event = new ResponseEvent($kernel, $request, HttpKernelInterface::SUB_REQUEST, $response);
    $dispatcher->dispatch($event, KernelEvents::RESPONSE);
    ......@@ -123,7 +122,7 @@ public function testDestinationRedirectToExternalUrl($request, $expected) {
    $kernel = $this->createMock('Symfony\Component\HttpKernel\HttpKernelInterface');
    $response = new RedirectResponse('http://other-example.com');
    $listener = new RedirectResponseSubscriber($this->urlAssembler, $this->requestContext, $this->prophesize(LoggerInterface::class)->reveal());
    $listener = new RedirectResponseSubscriber($this->urlAssembler, $this->requestContext, $this->prophesize(\Closure::class)->reveal());
    $dispatcher->addListener(KernelEvents::RESPONSE, [$listener, 'checkRedirectUrl']);
    $event = new ResponseEvent($kernel, $request, HttpKernelInterface::SUB_REQUEST, $response);
    $dispatcher->dispatch($event, KernelEvents::RESPONSE);
    ......@@ -140,7 +139,7 @@ public function testRedirectWithOptInExternalUrl() {
    $request = Request::create('');
    $request->headers->set('HOST', 'example.com');
    $listener = new RedirectResponseSubscriber($this->urlAssembler, $this->requestContext, $this->prophesize(LoggerInterface::class)->reveal());
    $listener = new RedirectResponseSubscriber($this->urlAssembler, $this->requestContext, $this->prophesize(\Closure::class)->reveal());
    $dispatcher->addListener(KernelEvents::RESPONSE, [$listener, 'checkRedirectUrl']);
    $event = new ResponseEvent($kernel, $request, HttpKernelInterface::SUB_REQUEST, $response);
    $dispatcher->dispatch($event, KernelEvents::RESPONSE);
    ......@@ -171,7 +170,7 @@ public function testDestinationRedirectWithInvalidUrl(Request $request) {
    $kernel = $this->createMock('Symfony\Component\HttpKernel\HttpKernelInterface');
    $response = new RedirectResponse('http://example.com/drupal');
    $listener = new RedirectResponseSubscriber($this->urlAssembler, $this->requestContext, $this->prophesize(LoggerInterface::class)->reveal());
    $listener = new RedirectResponseSubscriber($this->urlAssembler, $this->requestContext, $this->prophesize(\Closure::class)->reveal());
    $dispatcher->addListener(KernelEvents::RESPONSE, [$listener, 'checkRedirectUrl']);
    $event = new ResponseEvent($kernel, $request, HttpKernelInterface::SUB_REQUEST, $response);
    $dispatcher->dispatch($event, KernelEvents::RESPONSE);
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment