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

108 lines
3.6 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.statuses.create'));
$response->assertOk();
$response->assertViewIs('Staff.chat.status.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.');
$chatStatus = \App\Models\ChatStatus::factory()->create();
$user = \App\Models\User::factory()->create();
$response = $this->actingAs($user)->delete(route('staff.statuses.destroy', [$chatStatus]));
$response->assertOk();
$this->assertModelMissing($chatStatus);
// 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.');
$chatStatus = \App\Models\ChatStatus::factory()->create();
$user = \App\Models\User::factory()->create();
$response = $this->actingAs($user)->get(route('staff.statuses.edit', [$chatStatus]));
$response->assertOk();
$response->assertViewIs('Staff.chat.status.edit');
$response->assertViewHas('chatstatus');
// 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.');
$chatStatuses = \App\Models\ChatStatus::factory()->times(3)->create();
$user = \App\Models\User::factory()->create();
$response = $this->actingAs($user)->get(route('staff.statuses.index'));
$response->assertOk();
$response->assertViewIs('Staff.chat.status.index');
$response->assertViewHas('chatstatuses');
// TODO: perform additional assertions
});
test('store validates with a form request', function (): void {
$this->assertActionUsesFormRequest(
\App\Http\Controllers\Staff\ChatStatusController::class,
'store',
\App\Http\Requests\Staff\StoreChatStatusRequest::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.statuses.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\ChatStatusController::class,
'update',
\App\Http\Requests\Staff\UpdateChatStatusRequest::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.');
$chatStatus = \App\Models\ChatStatus::factory()->create();
$user = \App\Models\User::factory()->create();
$response = $this->actingAs($user)->post(route('staff.statuses.update', [$chatStatus]), [
// TODO: send request data
]);
$response->assertOk();
// TODO: perform additional assertions
});
// test cases...