CheckRememberMeConditionsListener example

use Symfony\Component\Security\Http\Event\LoginSuccessEvent;
use Symfony\Component\Security\Http\EventListener\CheckRememberMeConditionsListener;

class CheckRememberMeConditionsListenerTest extends TestCase
{
    private CheckRememberMeConditionsListener $listener;
    private Request $request;
    private Response $response;

    protected function setUp(): void
    {
        $this->listener = new CheckRememberMeConditionsListener();
    }

    public function testSuccessfulHttpLoginWithoutSupportingAuthenticator()
    {
        $this->createHttpRequest();

        $passport = $this->createPassport([]);

        $this->listener->onSuccessfulLogin($this->createLoginSuccessfulEvent($passport));

        $this->assertFalse($passport->hasBadge(RememberMeBadge::class));
    }
Home | Imprint | This part of the site doesn't use cookies.