Files
UNIT3D/tests/Feature/Http/Controllers/User/TopicControllerTest.php
2023-07-11 18:27:15 +00:00

22 lines
657 B
PHP

<?php
uses(RefreshDatabase::class);
test('index returns an ok response', function (): void {
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
$user = \App\Models\User::factory()->create();
$authUser = \App\Models\User::factory()->create();
$response = $this->actingAs($authUser)->get(route('users.topics.index', [$user]));
$response->assertOk();
$response->assertViewIs('user.topic.index');
$response->assertViewHas('user', $user);
$response->assertViewHas('topics');
// TODO: perform additional assertions
});
// test cases...