eZ\Publish\Core\MVC\Symfony\Security\User::isCredentialsNonExpired PHP Метод

isCredentialsNonExpired() публичный Метод

Internally, if this method returns false, the authentication system will throw a CredentialsExpiredException and prevent login.
См. также: CredentialsExpiredException
public isCredentialsNonExpired ( ) : boolean
Результат boolean true if the user's credentials are non expired, false otherwise
    public function isCredentialsNonExpired()
    {
        return true;
    }

Usage Example

Пример #1
0
 public function testConstruct()
 {
     $login = '******';
     $passwordHash = 'encoded_password';
     $apiUser = $this->getMockBuilder('eZ\\Publish\\API\\Repository\\Values\\User\\User')->setConstructorArgs(array(array('login' => $login, 'passwordHash' => $passwordHash, 'enabled' => true)))->getMockForAbstractClass();
     $roles = array('ROLE_USER');
     $user = new User($apiUser, $roles);
     $this->assertSame($apiUser, $user->getAPIUser());
     $this->assertSame($login, $user->getUsername());
     $this->assertSame($passwordHash, $user->getPassword());
     $this->assertSame($roles, $user->getRoles());
     $this->assertNull($user->getSalt());
     $this->assertTrue($user->isAccountNonExpired());
     $this->assertTrue($user->isAccountNonLocked());
     $this->assertTrue($user->isCredentialsNonExpired());
     $this->assertTrue($user->isEnabled());
 }