Completed
Push — master ( 311dae...76f744 )
by dan
05:40
created

PusherChannelVoterTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 1
A testSupports() 0 5 1
1
<?php
2
3
namespace IrishDan\NotificationBundle\Test\Security;
4
5
use IrishDan\NotificationBundle\PusherChannel;
6
use IrishDan\NotificationBundle\Security\PusherChannelVoter;
7
use IrishDan\NotificationBundle\Test\NotificationTestCase;
8
9
class PusherChannelVoterTest extends NotificationTestCase
10
{
11
    protected $voter;
12
    protected $pusherChannel;
13
14
    public function setUp()
15
    {
16
        $config = $this->getNotificationChannelConfiguration('pusher');
17
18
        $this->voter = new PusherChannelVoter(true, $config);
19
        $this->pusherChannel = new PusherChannel('pusher_test_1', '1234567');
20
    }
21
22
    public function testSupports()
23
    {
24
        // $supports = $this->voter->supports('subscribe', $this->pusherChannel);
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% 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...
25
        $token = $this->getToken();
0 ignored issues
show
Unused Code introduced by
$token is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
26
    }
27
}