for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Kunstmaan\AdminBundle\Tests\Helper\Security\Acl\Voter;
use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\PermissionMapInterface;
use Kunstmaan\AdminBundle\Helper\Security\Acl\Voter\AclVoter;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Acl\Model\AclProviderInterface;
use Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface;
use Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface;
class AclVoterTest extends TestCase
{
public function testCanConstruct()
$provider = $this->createMock(AclProviderInterface::class);
$oid = $this->createMock(ObjectIdentityRetrievalStrategyInterface::class);
$sid = $this->createMock(SecurityIdentityRetrievalStrategyInterface::class);
$map = $this->createMock(PermissionMapInterface::class);
$acl = new AclVoter($provider, $oid, $sid, $map);
$provider
object<PHPUnit\Framework\MockObject\MockObject>
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);
$oid
object<Symfony\Component...ievalStrategyInterface>
$sid
$map
object<Symfony\Component...PermissionMapInterface>
$this->assertInstanceOf(AclVoter::class, $acl);
}
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: