Пример #1
0
 /** @test */
 public function it_finds_a_user_with_statuses_by_username()
 {
     # Given
     $user = Factory::create(User::class);
     $statuses = Factory::times(3)->create(Status::class, ['user_id' => $user->id]);
     # When
     $results = $this->repo->findByUsername($user->username);
     # Then
     $this->assertEquals($user->username, $results->username);
     $this->assertCount(3, $results->statuses);
 }
Пример #2
0
 public function show(UserRepository $usersRepository, $username)
 {
     $user = $usersRepository->findByUsername($username);
     return view('users.show')->withUser($user);
 }