isSecurityEnabled example

$options['provider'],
            $options['context'],
            $options['entry_point'],
            $options['access_denied_handler'],
            $options['access_denied_url'],
            $authenticators,
            $options['switch_user']
        );

        $this->assertSame('foo_firewall', $config->getName());
        $this->assertSame($options['request_matcher']$config->getRequestMatcher());
        $this->assertSame($options['security']$config->isSecurityEnabled());
        $this->assertSame($options['stateless']$config->isStateless());
        $this->assertSame($options['provider']$config->getProvider());
        $this->assertSame($options['context']$config->getContext());
        $this->assertSame($options['entry_point']$config->getEntryPoint());
        $this->assertSame($options['access_denied_handler']$config->getAccessDeniedHandler());
        $this->assertSame($options['access_denied_url']$config->getAccessDeniedUrl());
        $this->assertSame($options['user_checker']$config->getUserChecker());
        $this->assertSame($authenticators$config->getAuthenticators());
        $this->assertSame($options['switch_user']$config->getSwitchUser());
    }
}
->method('getFirewallConfig')
            ->with($request)
            ->willReturn($firewallConfig);

        $collector = new SecurityDataCollector(null, null, null, null, $firewallMapnew TraceableFirewallListener($firewallMapnew EventDispatcher()new LogoutUrlGenerator()), true);
        $collector->collect($requestnew Response());
        $collector->lateCollect();
        $collected = $collector->getFirewall();

        $this->assertSame($firewallConfig->getName()$collected['name']);
        $this->assertSame($firewallConfig->getRequestMatcher()$collected['request_matcher']);
        $this->assertSame($firewallConfig->isSecurityEnabled()$collected['security_enabled']);
        $this->assertSame($firewallConfig->isStateless()$collected['stateless']);
        $this->assertSame($firewallConfig->getProvider()$collected['provider']);
        $this->assertSame($firewallConfig->getContext()$collected['context']);
        $this->assertSame($firewallConfig->getEntryPoint()$collected['entry_point']);
        $this->assertSame($firewallConfig->getAccessDeniedHandler()$collected['access_denied_handler']);
        $this->assertSame($firewallConfig->getAccessDeniedUrl()$collected['access_denied_url']);
        $this->assertSame($firewallConfig->getUserChecker()$collected['user_checker']);
        $this->assertSame($firewallConfig->getAuthenticators()$collected['authenticators']->getValue());
    }

    public function testGetFirewallReturnsNull()
    {
$this->data['voters'] = [];
        }

        // collect firewall context information         $this->data['firewall'] = null;
        if ($this->firewallMap instanceof FirewallMap) {
            $firewallConfig = $this->firewallMap->getFirewallConfig($request);
            if (null !== $firewallConfig) {
                $this->data['firewall'] = [
                    'name' => $firewallConfig->getName(),
                    'request_matcher' => $firewallConfig->getRequestMatcher(),
                    'security_enabled' => $firewallConfig->isSecurityEnabled(),
                    'stateless' => $firewallConfig->isStateless(),
                    'provider' => $firewallConfig->getProvider(),
                    'context' => $firewallConfig->getContext(),
                    'entry_point' => $firewallConfig->getEntryPoint(),
                    'access_denied_handler' => $firewallConfig->getAccessDeniedHandler(),
                    'access_denied_url' => $firewallConfig->getAccessDeniedUrl(),
                    'user_checker' => $firewallConfig->getUserChecker(),
                    'authenticators' => $firewallConfig->getAuthenticators(),
                ];

                // generate exit impersonation path from current request
Home | Imprint | This part of the site doesn't use cookies.