adrema/tests/Feature/Form/ParticipantAssignActionTest...

27 lines
741 B
PHP
Raw Permalink Normal View History

2024-07-02 18:04:55 +02:00
<?php
namespace Tests\Feature\Form;
use App\Form\Models\Form;
use App\Form\Models\Participant;
use App\Member\Member;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class ParticipantAssignActionTest extends TestCase
{
use DatabaseTransactions;
public function testItAssignsAParticipantToAMenber(): void
{
$this->login()->loginNami();
$participant = Participant::factory()->for(Form::factory())->create();
$member = Member::factory()->defaults()->create();
$this->postJson(route('participant.assign', ['participant' => $participant]), ['member_id' => $member->id])->assertOk();
$this->assertEquals($member->id, $participant->fresh()->member_id);
}
}