Completed
Push — translationunittests ( bfa466...5196ce )
by
unknown
29:38 queued 22:11
created

PageServeTest::makeUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Tests\Feature;
4
5
use Tests\TestCase;
6
use Illuminate\Foundation\Testing\RefreshDatabase;
7
use Illuminate\Foundation\Testing\WithoutMiddleware;
8
9
class PageServeTest extends TestCase {
10
11
    use WithoutMiddleware;
12
13
    //Moving to Selenium browser tests
14
15
    public function makeUser() {
16
        $user = factory(\App\Models\User::class)->make();
17
        return $user;
18
    }
19
20
    public function testRoot() {
21
        // Make a user
22
        $user = $this->makeUser();
23
        // Test homepage as user with session
24
        $response = $this->actingAs($user)
0 ignored issues
show
Bug introduced by
It seems like $user 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

24
        $response = $this->actingAs(/** @scrutinizer ignore-type */ $user)
Loading history...
25
                        ->get('/');
26
        // Should be successful
27
        $response->assertStatus(200);
28
        $response->assertViewIs('applicant.home');
29
    }
30
31
}
32