Nelmio\SecurityBundle\Tests\Listener\FlexibleSslListenerTest::testPostLoginKernelResponse PHP Method

testPostLoginKernelResponse() public method

    public function testPostLoginKernelResponse()
    {
        $request = Request::create('https://localhost/');
        $response = new Response();
        $event = new FilterResponseEvent($this->kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response);
        $this->listener->onPostLoginKernelResponse($event);
        $cookies = $response->headers->getCookies(ResponseHeaderBag::COOKIES_ARRAY);
        $this->assertTrue(isset($cookies['']['/']['auth']));
        $this->assertSame('1', $cookies['']['/']['auth']->getValue());
        $this->assertFalse($cookies['']['/']['auth']->isSecure());
        $this->assertTrue(isset($cookies['']['/'][session_name()]));
        $this->assertSame(session_id(), $cookies['']['/'][session_name()]->getValue());
        $this->assertTrue($cookies['']['/'][session_name()]->isSecure());
    }