for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace DoL\LdapBundle\Tests;
use DoL\LdapBundle\Model\LdapUserInterface;
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
class TestUser implements UserInterface, AdvancedUserInterface, LdapUserInterface
{
private $username;
private $password;
private $enabled;
private $locked;
private $dn;
private $roles = [];
public function setUsername($username)
$this->username = $username;
}
public function getUsername()
return $this->username;
public function setPassword($password)
$this->password = $password;
/**
* {@inheritdoc}
*/
public function getPassword()
return $this->password;
public function getSalt()
return null;
public function eraseCredentials()
public function getRoles()
return $this->roles;
public function setEnabled($enabled)
$this->enabled = $enabled;
public function isEnabled()
return $this->enabled;
public function setLocked($locked)
$this->locked = $locked;
public function setRoles($roles)
$this->roles = $roles;
public function isAccountNonLocked()
return !$this->locked;
public function isAccountNonExpired()
return true;
public function isCredentialsNonExpired()
public function setDn($dn)
$this->dn = $dn;
public function getDn()
return $this->dn;
public function __toString()
return (string) $this->getUsername();