TestAuthenticator example

public function testShouldNotCheckPassport($authenticator$passport)
    {
        $this->ldap->expects($this->never())->method('bind');

        $listener = $this->createListener();
        $listener->onCheckPassport(new CheckPassportEvent($authenticator$passport));
    }

    public static function provideShouldNotCheckPassport()
    {
        // no LdapBadge         yield [new TestAuthenticator()new Passport(new UserBadge('test')new PasswordCredentials('s3cret'))];

        // ldap already resolved         $badge = new LdapBadge('app.ldap');
        $badge->markResolved();
        yield [new TestAuthenticator()new Passport(new UserBadge('test')new PasswordCredentials('s3cret')[$badge])];
    }

    public function testPasswordCredentialsAlreadyResolvedThrowsException()
    {
        $this->expectException(\LogicException::class);
        $this->expectExceptionMessage('LDAP authentication password verification cannot be completed because something else has already resolved the PasswordCredentials.');

        
Home | Imprint | This part of the site doesn't use cookies.