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

JobControllerTest::testManagerIndex()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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