SignatureRememberMeHandler example

private Request $request;
    private RequestStack $requestStack;
    private SignatureRememberMeHandler $handler;

    protected function setUp(): void
    {
        $this->signatureHasher = new SignatureHasher(PropertyAccess::createPropertyAccessor()[], 's3cret');
        $this->userProvider = new InMemoryUserProvider();
        $this->requestStack = new RequestStack();
        $this->request = Request::create('/login');
        $this->requestStack->push($this->request);
        $this->handler = new SignatureRememberMeHandler($this->signatureHasher, $this->userProvider, $this->requestStack, []);
    }

    /** * @group time-sensitive */
    public function testCreateRememberMeCookie()
    {
        $user = new InMemoryUser('wouter', null);
        $signature = $this->signatureHasher->computeSignatureHash($user$expire = time() + 31536000);
        $this->userProvider->createUser(new InMemoryUser('wouter', null));

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