testCreateWithOneVoter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
c 1
b 0
f 0
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Symnedi\Security\Tests\Core\Authorization;
6
7
use PHPUnit\Framework\TestCase;
8
use Symfony\Component\Security\Core\Authorization\AccessDecisionManager;
9
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
10
use Symnedi\Security\Core\Authorization\AccessDecisionManagerFactory;
11
12
final class AccessDecisionManagerFactoryTest extends TestCase
13
{
14
    /**
15
     * @var AccessDecisionManagerFactory
16
     */
17
    private $accessDecisionManagerFactory;
18
19
    protected function setUp()
20
    {
21
        $this->accessDecisionManagerFactory = new AccessDecisionManagerFactory([]);
0 ignored issues
show
Unused Code introduced by
The call to AccessDecisionManagerFactory::__construct() has too many arguments starting with array().

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
22
    }
23
24
    public function testCreateWithOneVoter()
25
    {
26
        $voterMock = $this->prophesize(VoterInterface::class);
27
        $this->accessDecisionManagerFactory->addVoter($voterMock->reveal());
28
        $accessDecisionManager = $this->accessDecisionManagerFactory->create();
29
        $this->assertInstanceOf(AccessDecisionManager::class, $accessDecisionManager);
30
    }
31
}
32