GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 6ac563...2882a3 )
by Christian
01:48
created

MenuCompilerPassTest::testProcessWithEmptyGroups()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * (c) Christian Gripp <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Core23\MenuBundle\Tests\DependencyInjection\Compiler;
11
12
use Core23\MenuBundle\DependencyInjection\Compiler\MenuCompilerPass;
13
use PHPUnit\Framework\TestCase;
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\DependencyInjection\Definition;
16
17
class MenuCompilerPassTest extends TestCase
18
{
19
    /**
20
     * @var ContainerBuilder
21
     */
22
    private $container;
23
24
    protected function setUp()
25
    {
26
        $this->container = new ContainerBuilder();
27
    }
28
29
    public function testProcess(): void
30
    {
31
        $definition = $this->createMock(Definition::class);
32
        $definition->expects($this->once())->method('addMethodCall')
33
            ->with('add', ['main'])
34
        ;
35
36
        $this->container->setDefinition('sonata.block.menu.registry', $definition);
0 ignored issues
show
Documentation introduced by
$definition is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Symfony\Component...cyInjection\Definition>.

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...
37
        $this->container->setParameter('core23_menu.groups', [
38
            'main' => [
39
                'name'       => 'FooMenu',
40
                'attributes' => [
41
                    'class'    => 'my-class',
42
                ],
43
                'items' => [],
44
            ],
45
        ]);
46
47
        $compiler = new MenuCompilerPass();
48
        $compiler->process($this->container);
49
    }
50
51
    public function testProcessWithEmptyGroups(): void
52
    {
53
        $this->container->setParameter('core23_menu.groups', [
54
        ]);
55
56
        $compiler = new MenuCompilerPass();
57
        $compiler->process($this->container);
58
59
        $this->assertTrue(true);
60
    }
61
}
62