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

WebsiteControllerTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 9
dl 0
loc 23
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldDisplay404ForUnExistentUser() 0 4 1
A shouldDisplayHomePage() 0 4 1
A shouldDisplayUserInfoPage() 0 6 1
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