Completed
Pull Request — master (#105)
by Johan
04:52 queued 01:05
created

ProtectedDashboardPage   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 19
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testProtectedDashboardRoute() 0 10 1
1
<?php
2
3
namespace App\Containers\Authentication\UI\WEB\Tests\Functional;
4
5
use App\Ship\Parents\Tests\PhpUnit\TestCase;
6
use App\Ship\Parents\Tests\PhpUnit\WebTestCase;
7
use Illuminate\Foundation\Testing\WithoutMiddleware;
8
9
/**
10
 * Class UserLoginTest
11
 *
12
 * @author  Johan Alvarez <[email protected]>
13
 * @author  Mahmoud Zalt  <[email protected]>
14
 */
15
class ProtectedDashboardPage extends TestCase
16
{
17
    //use WithoutMiddleware;
18
19
    // overrides the default subDomain in the base URL
20
    protected $subDomain = 'admin';
21
    protected $endpoint = '/dashboard';
22
23
    public function testProtectedDashboardRoute()
24
    {
25
        // go to the protected page, without login
26
        $response = $this->get($this->endpoint);
27
28
        // should be redirected to login page
29
        $response->assertResponseStatus(302);
30
        $this->assertRedirectedTo('login');
31
        $this->see('login');
32
    }
33
}
34