Contao\CoreBundle\Test\EventListener\UserSessionListenerTest::getListener PHP Method

getListener() private method

Returns the session listener object.
private getListener ( Symfony\Component\HttpFoundation\Session\SessionInterface $session = null, Doctrine\DBAL\Connection $connection = null, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage = null ) : UserSessionListener
$session Symfony\Component\HttpFoundation\Session\SessionInterface
$connection Doctrine\DBAL\Connection
$tokenStorage Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface
return Contao\CoreBundle\EventListener\UserSessionListener
    private function getListener(SessionInterface $session = null, Connection $connection = null, TokenStorageInterface $tokenStorage = null)
    {
        if (null === $session) {
            $session = $this->mockSession();
        }
        if (null === $connection) {
            $connection = $this->getMock('Doctrine\\DBAL\\Connection', [], [], '', false);
        }
        if (null === $tokenStorage) {
            $tokenStorage = $this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorageInterface');
        }
        $trustResolver = new AuthenticationTrustResolver(AnonymousToken::class, RememberMeToken::class);
        return new UserSessionListener($session, $connection, $tokenStorage, $trustResolver);
    }