WebsiteControllerTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testShouldDisplayHomePage() 0 4 1
A testShouldDisplay404ForUnExistentUser() 0 4 1
A testShouldDisplayUserInfoPage() 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
    public function testShouldDisplayHomePage(): void
12
    {
13
        $response = $this->get('/');
14
        $response->assertResponseStatus(200);
15
    }
16
17
    public function testShouldDisplayUserInfoPage(): void
18
    {
19
        $users = ['_Cyb3r', 'hackLover', 'RaynLegends', 'xPeppe'];
20
        $user = array_rand($users);
21
        $response = $this->get('/user/'.$users[$user]);
22
        $response->assertResponseStatus(200);
23
    }
24
25
    public function testShouldDisplay404ForUnExistentUser(): void
26
    {
27
        $response = $this->get('/user/IHopeThisUserDoesNotExists');
28
        $response->assertResponseStatus(404);
29
    }
30
}
31