GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

SecurityListenerTest::testAccess()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace APL\Tests\Security;
4
5
use APL\Security\SecurityListener;
6
use APL\Event\PreCommandEvent;
7
8
/**
9
 *
10
 * @author David Badura <[email protected]>
11
 */
12
class SecurityListenerTest extends \PHPUnit_Framework_TestCase
13
{
14
15
    public function testAccess()
16
    {
17
        $listener = new SecurityListener();
18
        $listener->addPolicy($this->createFakePolicy(true));
19
        $listener->preCommand($this->createPreCommandEvent());
20
    }
21
22
    /**
23
     *
24
     * @expectedException \APL\Exception\SecurityException
25
     */
26
    public function testDenied()
27
    {
28
        $listener = new SecurityListener();
29
        $listener->addPolicy($this->createFakePolicy(false));
30
        $listener->preCommand($this->createPreCommandEvent());
31
    }
32
33
    /**
34
     *
35
     * @return PreCommandEvent
36
     */
37
    private function createPreCommandEvent()
38
    {
39
        return new PreCommandEvent($this->getMock('APL\Command\CommandInterface'));
40
    }
41
42
    /**
43
     *
44
     * @param bool $return
45
     * @return \APL\Security\PolicyInterface
46
     */
47
    private function createFakePolicy($return)
48
    {
49
        $policy = $this->getMock('APL\Security\PolicyInterface');
50
        $policy
51
            ->expects($this->once())
52
            ->method('check')
53
            ->will($this->returnValue($return));
54
55
        return $policy;
56
    }
57
}
58