Passed
Push — master ( 10a915...0d23d6 )
by Mattia
08:28 queued 11s
created

shouldDisplay404ForUnExistentUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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