Skip to content
Snippets Groups Projects
Select Git revision
  • ci-update
  • main default
  • keycloak-deprecate
  • remove-jwt-easy
  • v0.1.15
  • v0.1.14
  • v0.1.13
  • v0.1.12
  • v0.1.11
  • v0.1.10
  • v0.1.9
  • v0.1.8
  • v0.1.7
  • v0.1.6
  • v0.1.5
  • v0.1.4
  • v0.1.3
  • v0.1.2
  • v0.1.1
  • v0.1.0
20 results

DummyUserSession.php

Blame
  • DummyUserSession.php 898 B
    <?php
    
    declare(strict_types=1);
    
    namespace Dbp\Relay\AuthBundle\Tests;
    
    use Dbp\Relay\CoreBundle\API\UserSessionInterface;
    
    class DummyUserSession implements UserSessionInterface
    {
        private $jwt;
        private $id;
        private $roles;
    
        public function __construct(?string $id = 'id', array $roles = [])
        {
            $this->id = $id;
            $this->roles = $roles;
        }
    
        public function setSessionToken(?array $jwt): void
        {
            $this->jwt = $jwt;
        }
    
        public function getUserIdentifier(): ?string
        {
            return $this->id;
        }
    
        public function getUserRoles(): array
        {
            return $this->roles;
        }
    
        public function getSessionLoggingId(): ?string
        {
            return 'logging-id';
        }
    
        public function getSessionCacheKey(): ?string
        {
            return 'cache';
        }
    
        public function getSessionTTL(): int
        {
            return 42;
        }
    }