withoutExceptionHandling(); $this->actingAs($user = factory(User::class)->create(), 'api'); $response = $this->get('/api/auth-user'); $response->assertStatus(200) ->assertJson([ 'data' => [ 'user_id' => $user->id, 'attributes' => [ 'name' => $user->name, ] ], 'links' => [ 'self' => url('/users/'. $user->id), ] ]); } }