/
ExFuseMe
/
shaurmacity
Обзор
Документация
Войти
/
ExFuseMe
/
shaurmacity
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/Feature/ProfileInformationTest.php
36 строк
1 KB
ExFuseMe
Install Jetstream
13 июн 2024, 10:28
13 июн 2024, 10:28
0a53018
Код
Авторство
О чём код?
<?php namespace Tests\Feature; use App\Models\User; use Illuminate\Foundation\Testing\RefreshDatabase; use Laravel\Jetstream\Http\Livewire\UpdateProfileInformationForm; use Livewire\Livewire; use Tests\TestCase; class ProfileInformationTest extends TestCase { use RefreshDatabase; public function test_current_profile_information_is_available(): void { $this->actingAs($user = User::factory()->create()); $component = Livewire::test(UpdateProfileInformationForm::class); $this->assertEquals($user->name, $component->state['name']); $this->assertEquals($user->email, $component->state['email']); } public function test_profile_information_can_be_updated(): void { $this->actingAs($user = User::factory()->create()); Livewire::test(UpdateProfileInformationForm::class) ->set('state', ['name' => 'Test Name', 'email' => 'test@example.com']) ->call('updateProfileInformation'); $this->assertEquals('Test Name', $user->fresh()->name); $this->assertEquals('test@example.com', $user->fresh()->email); } }