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.
Completed
Push — master ( a51d8d...661062 )
by Edi
23:20
created

SiteAccessVoterTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 25 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Netgen\Bundle\SiteAccessRoutesBundle\Tests\Matcher\Voter;
4
5
use Netgen\Bundle\SiteAccessRoutesBundle\Matcher\Voter\SiteAccessVoter;
6
use Netgen\Bundle\SiteAccessRoutesBundle\Matcher\Voter\VoterInterface;
7
use Netgen\Bundle\SiteAccessRoutesBundle\Tests\TestCase;
8
9
class SiteAccessVoterTest extends TestCase
10
{
11
    /**
12
     * @var \Netgen\Bundle\SiteAccessRoutesBundle\Matcher\Voter\SiteAccessVoter
13
     */
14
    protected $voter;
15
16
    public function setUp()
17
    {
18
        $this->voter = new SiteAccessVoter();
19
    }
20
21
    /**
22
     * @param string $siteAccess
23
     * @param array $groupConfig
24
     * @param bool $vote
25
     *
26
     * @covers \Netgen\Bundle\SiteAccessRoutesBundle\Matcher\Voter\SiteAccessVoter::vote
27
     *
28
     * @dataProvider voteProvider
29
     */
30
    public function testVote($siteAccess, array $groupConfig, $vote)
31
    {
32
        $this->assertEquals($vote, $this->voter->vote($siteAccess, $groupConfig));
33
    }
34
35
    public function voteProvider()
36
    {
37
        return array(
38
            array('cro', array('cro', 'eng'), true),
39
            array('eng', array('cro', 'eng'), true),
40
            array('admin', array('cro', 'eng'), VoterInterface::ABSTAIN),
41
            array('extra', array('cro', 'eng'), VoterInterface::ABSTAIN),
42
        );
43
    }
44
}
45