mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-20 20:04:20 -06:00
47 lines
1.6 KiB
PHP
47 lines
1.6 KiB
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.earnings.index', [$user]));
|
|
|
|
$response->assertOk();
|
|
$response->assertViewIs('user.earning.index');
|
|
$response->assertViewHas('user', $user);
|
|
$response->assertViewHas('bon');
|
|
$response->assertViewHas('dying');
|
|
$response->assertViewHas('legendary');
|
|
$response->assertViewHas('old');
|
|
$response->assertViewHas('huge');
|
|
$response->assertViewHas('large');
|
|
$response->assertViewHas('regular');
|
|
$response->assertViewHas('participant');
|
|
$response->assertViewHas('teamplayer');
|
|
$response->assertViewHas('committed');
|
|
$response->assertViewHas('mvp');
|
|
$response->assertViewHas('legend');
|
|
$response->assertViewHas('total');
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('index 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();
|
|
$authUser = \App\Models\User::factory()->create();
|
|
|
|
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
|
|
|
$response = $this->actingAs($authUser)->get(route('users.earnings.index', [$user]));
|
|
|
|
$response->assertForbidden();
|
|
});
|
|
|
|
// test cases...
|