actingAs($user = User::factory()->createOne()); $component = Livewire::test(UpdateProfileInformationForm::class); static::assertEquals($user->name, $component->state['name']); static::assertEquals($user->email, $component->state['email']); } /** * Profile information can be updated. * * @return void */ public function testProfileInformationCanBeUpdated(): void { $this->actingAs($user = User::factory()->createOne()); Livewire::test(UpdateProfileInformationForm::class) ->set('state', ['name' => 'Test Name', 'email' => 'test@example.com']) ->call('updateProfileInformation'); static::assertEquals('Test Name', $user->fresh()->name); static::assertEquals('test@example.com', $user->fresh()->email); } }