Skip to content

Commit

Permalink
Merge pull request #156 from loic425/features/set-username-on-admin-u…
Browse files Browse the repository at this point in the history
…ser-example-factory

Set username on admin user example factory
  • Loading branch information
loic425 committed Mar 15, 2019
2 parents 68a9a6f + b11a9f1 commit 92bfa83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Fixture/Factory/AdminUserExampleFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function create(array $options = [])
/** @var AdminUser $user */
$user = $this->adminUserFactory->createNew();
$user->setEmail($options['email']);
$user->setUsername($options['username']);
$user->setPlainPassword($options['password']);
$user->setEnabled($options['enabled']);

Expand All @@ -80,6 +81,9 @@ protected function configureOptions(OptionsResolver $resolver)
->setDefault('email', function (Options $options) {
return $this->faker->email;
})
->setDefault('username', function (Options $options): string {
return $this->faker->firstName.' '.$this->faker->lastName;
})
->setDefault('enabled', true)
->setAllowedTypes('enabled', 'bool')
->setDefault('password', 'password')
Expand Down

0 comments on commit 92bfa83

Please sign in to comment.