adrema/tests/Feature/Member/UpdateTest.php

38 lines
883 B
PHP
Raw Normal View History

2021-06-13 11:33:50 +02:00
<?php
namespace Tests\Feature\Member;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
use App\Member\Member;
use App\Country;
use App\Nationality;
use App\Fee;
use App\Group;
class UpdateTest extends TestCase
{
use RefreshDatabase;
public function test_it_can_update_a_member()
{
2021-06-18 23:36:06 +02:00
$this->withoutExceptionHandling();
$this->login();
2021-06-13 11:33:50 +02:00
$member = Member::factory()
->for(Country::factory())
->for(Group::factory()->state(['nami_id' => 12399]))
->for(Nationality::factory())
->for(Fee::factory())
->create(['firstname' => 'Max', 'nami_id' => 999]);
$member->update(['firstname' => 'Jane']);
$this->assertMemberExists(12399, [
'vorname' => 'Jane',
'id' => 999
]);
}
}