Passed
Push — master ( 9aa048...898b5e )
by Mattia
04:05
created

shouldDisplay404ForUnExistentUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MinepicTests\Http\Controllers;
6
7
use MinepicTests\TestCase;
8
9
class WebsiteControllerTest extends TestCase
10
{
11
    /** @test */
12
    public function shouldDisplayHomePage(): void
13
    {
14
        $response = $this->get('/');
15
        $response->assertResponseStatus(200);
16
    }
17
18
    /** @test */
19
    public function shouldDisplayUserInfoPage(): void
20
    {
21
        $users = ['_Cyb3r', 'hackLover', 'RaynLegends', 'xPeppe'];
22
        $user = \array_rand($users);
23
        $response = $this->get('/user/'.$users[$user]);
24
        $response->assertResponseStatus(200);
25
    }
26
27
    /** @test */
28
    public function shouldDisplay404ForUnExistentUser(): void
29
    {
30
        $response = $this->get('/user/IHopeThisUserDoesNotExists');
31
        $response->assertResponseStatus(404);
32
    }
33
}
34