Completed
Push — l10n_master ( 6cb695...818918 )
by Kunstmaan
50:17 queued 35:37
created

Helper/AdminPanel/SitesAdminPanelAdaptorTest.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\MultiDomainBundle\Tests\Helper\AdminPanel;
4
5
use Kunstmaan\MultiDomainBundle\Helper\AdminPanel\SitesAdminPanelAdaptor;
6
use PHPUnit\Framework\TestCase;
7
8
class SitesAdminPanelAdaptorTest extends TestCase
9
{
10
    /**
11
     * @var SitesAdminPanelAdaptor
12
     */
13
    protected $object;
14
15
    /**
16
     * Sets up the fixture, for example, opens a network connection.
17
     * This method is called before a test is executed.
18
     */
19
    protected function setUp()
20
    {
21
        $this->object = new SitesAdminPanelAdaptor();
22
    }
23
24
    public function testGetAdminPanelActions()
25
    {
26
        $actions = $this->object->getAdminPanelActions();
27
        $this->assertCount(1, $actions);
0 ignored issues
show
$actions is of type array<integer,object<Kun...l\\AdminPanelAction>"}>, but the function expects a object<Countable>|object...nit\Framework\iterable>.

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...
28
29
        $action = $actions[0];
30
        $this->assertEquals('KunstmaanMultiDomainBundle_switch_site', $action->getUrl()['path']);
31
    }
32
}
33