Exemplo n.º 1
0
 /** @test */
 public function should_generate_valid_username_if_already_exists()
 {
     $first = FirstName::fromNative('Evey');
     $last = LastName::fromNative('Edward');
     $this->repository->shouldReceive('userOfUsername')->andReturn(true, true, null);
     $username = $this->registrar->generateUsername($first, $last);
     $this->assertEquals('eveyedward3', $username->toString());
 }
Exemplo n.º 2
0
 public static function create()
 {
     //        return 'here';
     $faker = Factory::create();
     $identifier = UserId::generate();
     $email = Email::fromNative($faker->email);
     $first = FirstName::fromNative($faker->word);
     $last = LastName::fromNative($faker->word);
     $username = Username::fromNative($faker->word);
     $password = HashedPassword::fromNative(str_random(10));
     return User::create($identifier, $email, $first, $last, $username, $password);
 }
Exemplo n.º 3
0
 /** @test */
 public function should_create_from_native()
 {
     $last_name = LastName::fromNative('Edward');
     $this->assertInstanceOf('Cffs\\Domain\\Model\\Identity\\LastName', $last_name);
 }
Exemplo n.º 4
0
 /**
  * Get the User's first name
  *
  * @return string
  */
 public function lastName()
 {
     return LastName::fromNative($this->lastName);
 }