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.

Core23MenuExtensionTest::testLoadDefault()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 56

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 56
rs 8.9599
c 0
b 0
f 0
cc 1
nc 1
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

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;
11
12
use Core23\MenuBundle\DependencyInjection\Core23MenuExtension;
13
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
14
15
final class Core23MenuExtensionTest extends AbstractExtensionTestCase
16
{
17
    public function testLoadDefault(): void
18
    {
19
        $this->load([
20
            'groups' => [
21
                'test' => [
22
                    'name'       => 'FooMenu',
23
                    'attributes' => [
24
                        'class'    => 'my-class',
25
                    ],
26
                    'items' => [
27
                        'foo' => [
28
                            'label'    => 'my-label',
29
                        ],
30
                        'bar' => [
31
                            'label'       => 'my-other-label',
32
                            'icon'        => 'fa fa-home',
33
                            'route'       => 'my-route',
34
                            'routeParams' => ['foo' => 'bar'],
35
                        ],
36
                    ],
37
                ],
38
            ],
39
        ]);
40
41
        $this->assertContainerBuilderHasService('core23_menu.builder.config');
42
        $this->assertContainerBuilderHasService('core23_menu.config_provider');
43
44
        $this->assertContainerBuilderHasParameter('core23_menu.groups', [
45
            'static_test' => [
46
                'name'       => 'FooMenu',
47
                'attributes' => [
48
                    'class'    => 'my-class',
49
                ],
50
                'items'           => [
51
                    'foo' => [
52
                        'label'           => 'my-label',
53
                        'label_catalogue' => false,
54
                        'icon'            => null,
55
                        'class'           => null,
56
                        'route'           => null,
57
                        'routeParams'     => [],
58
                        'children'        => [],
59
                    ],
60
                    'bar' => [
61
                        'label'           => 'my-other-label',
62
                        'icon'            => 'fa fa-home',
63
                        'route'           => 'my-route',
64
                        'routeParams'     => ['foo' => 'bar'],
65
                        'label_catalogue' => false,
66
                        'class'           => null,
67
                        'children'        => [],
68
                    ],
69
                ],
70
            ],
71
        ]);
72
    }
73
74
    protected function getContainerExtensions(): array
75
    {
76
        return [
77
            new Core23MenuExtension(),
78
        ];
79
    }
80
}
81