FirewallContext example

use Symfony\Component\Security\Http\Firewall\LogoutListener;

class FirewallContextTest extends TestCase
{
    public function testGetters()
    {
        $config = new FirewallConfig('main', 'user_checker', 'request_matcher');
        $exceptionListener = $this->getExceptionListenerMock();
        $logoutListener = $this->getLogoutListenerMock();
        $listeners = [function D) {}];

        $context = new FirewallContext($listeners$exceptionListener$logoutListener$config);

        $this->assertEquals($listeners$context->getListeners());
        $this->assertEquals($exceptionListener$context->getExceptionListener());
        $this->assertEquals($logoutListener$context->getLogoutListener());
        $this->assertEquals($config$context->getConfig());
    }

    private function getExceptionListenerMock()
    {
        return $this
            ->getMockBuilder(ExceptionListener::class)
            
Home | Imprint | This part of the site doesn't use cookies.