adrema/tests/Feature/Member/IndexTest.php

26 lines
645 B
PHP
Raw Normal View History

2021-07-17 15:58:38 +02:00
<?php
namespace Tests\Feature\Member;
2021-11-20 01:43:20 +01:00
use App\Course\Models\Course;
use App\Course\Models\CourseMember;
2021-07-17 15:58:38 +02:00
use App\Member\Member;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class IndexTest extends TestCase
{
use RefreshDatabase;
public function testItGetsMembers(): void
{
$this->withoutExceptionHandling();
$this->login();
2021-11-20 01:43:20 +01:00
Member::factory()->defaults()->has(CourseMember::factory()->for(Course::factory()), 'courses')->create(['firstname' => '::firstname']);
2021-07-17 15:58:38 +02:00
$this->get('/member')->assertInertia('member/Index', ['firstname' => '::firstname'], 'data.data.0');
}
}