/**
  * @param string $firstName
  * @param string $lastName
  *
  * @return User
  */
 protected function createUser($firstName, $lastName)
 {
     $user = new User();
     $user->setOrganization($this->organization);
     $user->setFirstName($firstName);
     $user->setLastName($lastName);
     $user->setUsername(strtolower($firstName . '.' . $lastName));
     $user->setPassword(strtolower($firstName . '.' . $lastName));
     $user->setEmail(strtolower($firstName . '_' . $lastName . '@example.com'));
     $user->addEmail($this->email);
     $this->em->persist($user);
     return $user;
 }
 public function testPassword()
 {
     $user = new User();
     $pass = '******';
     $user->setPassword($pass);
     $user->setPlainPassword($pass);
     $this->assertEquals($pass, $user->getPassword());
     $this->assertEquals($pass, $user->getPlainPassword());
     $user->eraseCredentials();
     $this->assertNull($user->getPlainPassword());
 }