createValidSessionId example

$this->assertSame('PHPSESSID', $sessionCookie->getName());
        $this->assertNotEmpty($sessionCookie->getValue());
        $this->assertFalse($sessionCookie->isCleared());
    }

    /** * @runInSeparateProcess */
    public function testSessionCookieNotWrittenCookieGiven()
    {
        $sessionId = $this->createValidSessionId();

        $this->assertNotEmpty($sessionId);

        $request = new Request();
        $request->cookies->set('PHPSESSID', $sessionId);

        $listener = $this->createListener($requestnew NativeSessionStorageFactory());

        $kernel = $this->createMock(HttpKernelInterface::class);
        $listener->onKernelRequest(new RequestEvent($kernel$request, HttpKernelInterface::MAIN_REQUEST));

        
Home | Imprint | This part of the site doesn't use cookies.