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

92 lines
3.0 KiB
PHP

<?php
uses(RefreshDatabase::class);
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.');
$subscription = \App\Models\Subscription::factory()->create();
$user = \App\Models\User::factory()->create();
$response = $this->actingAs($user)->post(route('subscriptions.destroy', ['id' => $subscription->id]), [
// TODO: send request data
]);
$response->assertOk();
// TODO: perform additional assertions
});
test('destroy aborts with a 403', function (): void {
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
$subscription = \App\Models\Subscription::factory()->create();
$user = \App\Models\User::factory()->create();
// TODO: perform additional setup to trigger `abort_unless(403)`...
$response = $this->actingAs($user)->post(route('subscriptions.destroy', ['id' => $subscription->id]), [
// TODO: send request data
]);
$response->assertForbidden();
});
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('subscriptions.index'));
$response->assertOk();
$response->assertViewIs('forum.subscriptions');
$response->assertViewHas('user', $user);
// TODO: perform additional assertions
});
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('subscriptions.store'), [
// TODO: send request data
]);
$response->assertOk();
// TODO: perform additional assertions
});
test('store aborts with a 403', 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();
// TODO: perform additional setup to trigger `abort_unless(403)`...
$response = $this->actingAs($user)->post(route('subscriptions.store'), [
// TODO: send request data
]);
$response->assertForbidden();
});
test('store aborts with a 403', 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();
// TODO: perform additional setup to trigger `abort_unless(403)`...
$response = $this->actingAs($user)->post(route('subscriptions.store'), [
// TODO: send request data
]);
$response->assertForbidden();
});
// test cases...