コード例 #1
0
 /**
  * @expectedException \LogicException
  */
 public function testCreateUserAlreadyExist()
 {
     $provider = new InMemoryUserProvider();
     $provider->createUser(new User('fabien', 'foo'));
     $provider->createUser(new User('fabien', 'foo'));
 }
 /**
  * Add a new user to the list of hard-coded users.
  * @param string $username Username
  * @param string $password Plain-text password
  * @param array $roles
  */
 public function addUser($username, $password, array $roles)
 {
     $this->userProvider->createUser(new User($username, $password, $roles));
 }