createUser([ 'password' => 'demodemo', ]); $response = $this->withSession([])->postJson('/api/login', [ 'email' => $user->email, 'password' => 'demodemo', ]); $response->assertStatus(200) ->assertJsonFragment([ 'id' => $user->id, 'email' => $user->email, ]); } public function test_login_inactive_user_fails(): void { $user = $this->createInactiveUser([ 'password' => 'demodemo', ]); $response = $this->withSession([])->postJson('/api/login', [ 'email' => $user->email, 'password' => 'demodemo', ]); $response->assertStatus(422); } }