Passed
Push — feature/http-tests ( 2cbc54...ff0812 )
by
unknown
08:12
created

JobControllerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testManagerIndex() 0 11 1
1
<?php
2
3
namespace Tests\Unit;
4
5
use Tests\TestCase;
6
use Illuminate\Foundation\Testing\WithFaker;
7
use Illuminate\Foundation\Testing\RefreshDatabase;
8
9
use App\Models\User;
10
11
class JobControllerTest extends TestCase
12
{
13
    /**
14
     * Ensure a manager can view their index page.
15
     *
16
     * @return void
17
     */
18
    public function testManagerIndex()
19
    {
20
        $manager = factory(User::class)->make(
21
            [
22
                'user_role_id' => 2
23
            ]
24
        );
25
26
        $response = $this->actingAs($manager)
0 ignored issues
show
Bug introduced by
It seems like $manager can also be of type Illuminate\Database\Eloquent\Model; however, parameter $user of Illuminate\Foundation\Testing\TestCase::actingAs() does only seem to accept Illuminate\Contracts\Auth\Authenticatable, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

26
        $response = $this->actingAs(/** @scrutinizer ignore-type */ $manager)
Loading history...
27
                        ->get('manager/jobs');
28
        $response->assertStatus(200);
29
    }
30
}
31