Completed
Push — master ( 2196f1...1dc6e5 )
by Jeroen
21s queued 13s
created

UserProcessorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testConstructorContainerDeprecation() 0 5 1
1
<?php
2
3
namespace Kunstmaan\AdminBundle\Tests\unit\Helper;
4
5
use Kunstmaan\AdminBundle\Helper\UserProcessor;
6
use PHPUnit\Framework\TestCase;
7
use Symfony\Component\DependencyInjection\ContainerInterface;
8
9
class UserProcessorTest extends TestCase
10
{
11
    /**
12
     * @group legacy
13
     * @expectedDeprecation Passing the container as the first argument of "Kunstmaan\AdminBundle\Helper\UserProcessor" is deprecated in KunstmaanAdminBundle 5.4 and will be removed in KunstmaanAdminBundle 6.0. Inject the "security.token_storage" service instead.
14
     */
15
    public function testConstructorContainerDeprecation()
16
    {
17
        $container = $this->createMock(ContainerInterface::class);
18
        new UserProcessor($container);
0 ignored issues
show
Documentation introduced by
$container is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Symfony\Component...\TokenStorageInterface>.

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...
19
    }
20
}
21