Completed
Push — master ( 939aa5...a3a240 )
by Jake
05:35
created

AdminControllerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_returns_dashboard_if_user_is_authenticated() 0 8 1
A test_redirects_to_login_if_user_is_not_authenticated() 0 5 1
1
<?php
2
3
use MeestorHok\Blue\Http\Controllers\AdminController;
4
5
use Illuminate\Foundation\Testing\WithoutMiddleware;
6
use Illuminate\Foundation\Testing\DatabaseMigrations;
7
use Illuminate\Foundation\Testing\DatabaseTransactions;
8
9
class AdminControllerTest extends TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
10
{
11
    /**
12
     * 'admin' Route
13
     * 
14
     * User logged in
15
     */
16
    public function test_returns_dashboard_if_user_is_authenticated ()
17
    {
18
        $user = factory(App\User::class)->create();
19
        
20
        $this->actingAs($user, 'admin')
21
             ->call('GET', 'admin')
22
             ->see('Waddup, y\'all');
23
    }
24
    
25
    /**
26
     * 'admin' Route
27
     * 
28
     * User Not logged in
29
     */
30
    public function test_redirects_to_login_if_user_is_not_authenticated ()
31
    {
32
        $this->call('GET', 'admin')
33
             ->assertRedirectedTo('login');
34
    }
35
}