Completed
Push — 5.6 ( c5fe0b...561087 )
by Jeroen
19:25 queued 04:42
created

AclVoterTest::testCanConstruct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Kunstmaan\AdminBundle\Tests\Helper\Security\Acl\Voter;
4
5
use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\PermissionMapInterface;
6
use Kunstmaan\AdminBundle\Helper\Security\Acl\Voter\AclVoter;
7
use PHPUnit\Framework\TestCase;
8
use Symfony\Component\Security\Acl\Model\AclProviderInterface;
9
use Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface;
10
use Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface;
11
12
class AclVoterTest extends TestCase
13
{
14
    public function testCanConstruct()
15
    {
16
        $provider = $this->createMock(AclProviderInterface::class);
17
        $oid = $this->createMock(ObjectIdentityRetrievalStrategyInterface::class);
18
        $sid = $this->createMock(SecurityIdentityRetrievalStrategyInterface::class);
19
        $map = $this->createMock(PermissionMapInterface::class);
20
        $acl = new AclVoter($provider, $oid, $sid, $map);
0 ignored issues
show
Documentation introduced by
$provider is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Symfony\Component...l\AclProviderInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Documentation introduced by
$oid is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Symfony\Component...ievalStrategyInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Documentation introduced by
$sid is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Symfony\Component...ievalStrategyInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
Documentation introduced by
$map is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Symfony\Component...PermissionMapInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
21
        $this->assertInstanceOf(AclVoter::class, $acl);
22
    }
23
}
24