Files
UNIT3D-Community-Edition/tests/Feature/Http/Controllers/Staff/ChatRoomControllerTest.shift.php
2023-07-11 18:27:15 +00:00

107 lines
3.5 KiB
PHP

<?php
uses(RefreshDatabase::class);
test('create 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();
$response = $this->actingAs($user)->get(route('staff.chatrooms.create'));
$response->assertOk();
$response->assertViewIs('Staff.chat.room.create');
// TODO: perform additional assertions
});
test('destroy 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.');
$chatroom = \App\Models\Chatroom::factory()->create();
$user = \App\Models\User::factory()->create();
$response = $this->actingAs($user)->delete(route('staff.chatrooms.destroy', [$chatroom]));
$response->assertOk();
$this->assertModelMissing($chatroom);
// TODO: perform additional assertions
});
test('edit 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.');
$chatroom = \App\Models\Chatroom::factory()->create();
$user = \App\Models\User::factory()->create();
$response = $this->actingAs($user)->get(route('staff.chatrooms.edit', [$chatroom]));
$response->assertOk();
$response->assertViewIs('Staff.chat.room.edit');
$response->assertViewHas('chatroom', $chatroom);
// TODO: perform additional assertions
});
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();
$response = $this->actingAs($user)->get(route('staff.chatrooms.index'));
$response->assertOk();
$response->assertViewIs('Staff.chat.room.index');
$response->assertViewHas('chatrooms');
// TODO: perform additional assertions
});
test('store validates with a form request', function (): void {
$this->assertActionUsesFormRequest(
\App\Http\Controllers\Staff\ChatRoomController::class,
'store',
\App\Http\Requests\Staff\StoreChatRoomRequest::class
);
});
test('store 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();
$response = $this->actingAs($user)->post(route('staff.chatrooms.store'), [
// TODO: send request data
]);
$response->assertOk();
// TODO: perform additional assertions
});
test('update validates with a form request', function (): void {
$this->assertActionUsesFormRequest(
\App\Http\Controllers\Staff\ChatRoomController::class,
'update',
\App\Http\Requests\Staff\UpdateChatRoomRequest::class
);
});
test('update 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.');
$chatroom = \App\Models\Chatroom::factory()->create();
$user = \App\Models\User::factory()->create();
$response = $this->actingAs($user)->post(route('staff.chatrooms.update', [$chatroom]), [
// TODO: send request data
]);
$response->assertOk();
// TODO: perform additional assertions
});
// test cases...