I have used following lines of code to create a user.
$newUser = new User(); $plainPassword = \'test\'; $hashPassword = $this->passwordEncoder->encodePa