Completed
Push — master ( 7f2734...860ce2 )
by Jake
02:21
created

AdminControllerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 29
rs 10
wmc 2
lcom 0
cbo 1
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 16 and the first side effect is on line 10.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
use MeestorHok\Blue\Http\Controllers\AdminController;
4
//use Illuminate\Contracts\View\Factory;
5
use Illuminate\Http\Request;
6
use Illuminate\Routing\RouteCollection;
7
use Illuminate\Routing\UrlGenerator;
8
9
10
class AdminControllerTest extends PHPUnit_Framework_TestCase
0 ignored issues
show
Bug introduced by
Possible parse error: class missing opening or closing brace
Loading history...
11
{
12
    
13
    /** 
14
     * Setup the test environment. 
15
     */ 
16
    public function setUp() 
17
    { 
18
        $this->urlGenerator = new UrlGenerator(new RouteCollection(), Request::create('/', 'GET'));
19
    }
20
    
21
    public function test_returns_dashboard_if_user_is_authenticated ()
22
    {
23
        // $user = factory(App\User::class)->create();
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
24
        
25
        // $this->actingAs($user, 'admin')
0 ignored issues
show
Unused Code Comprehensibility introduced by
70% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
26
        //      ->call('GET', 'admin')
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
27
        //      ->see('Waddup, y\'all');
28
        // $this->assertTrue(true);
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
29
        $request = $this->urlGenerator->to('admin')->see('Waddup, y\'all');
30
        $this->assertFalse($request);
31
    }
32
    
33
    public function test_redirects_to_login_if_user_is_not_authenticated ()
34
    {
35
        $request = $this->urlGenerator->to(admin')->assertRedirectedTo('login');
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ')'
Loading history...
36
        //$this->assertTrue(true);
37
    }
38
}
39