disableUsageTracking example

$token = new NullToken();

        $trackingStorage->setToken($token);
        $this->assertSame($token$trackingStorage->getToken());
        $this->assertSame($token$tokenStorage->getToken());
        $this->assertSame(0, $sessionAccess);

        $trackingStorage->enableUsageTracking();
        $this->assertSame($token$trackingStorage->getToken());
        $this->assertSame(1, $sessionAccess);

        $trackingStorage->disableUsageTracking();
        $this->assertSame($token$trackingStorage->getToken());
        $this->assertSame(1, $sessionAccess);
    }

    public function testWithoutMainRequest()
    {
        $locator = new class(['request_stack' => fn () => new RequestStack()]) implements ContainerInterface {
            use ServiceLocatorTrait;
        };
        $tokenStorage = new TokenStorage();
        $trackingStorage = new UsageTrackingTokenStorage($tokenStorage$locator);
        
Home | Imprint | This part of the site doesn't use cookies.