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 ( d508c8...a54e83 )
by Christian
01:30
created

ConfigProviderTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
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\Provider;
11
12
use Core23\MenuBundle\Menu\ConfigBuilderInterface;
13
use Core23\MenuBundle\Provider\ConfigProvider;
14
use InvalidArgumentException;
15
use Knp\Menu\ItemInterface;
16
use PHPUnit\Framework\TestCase;
17
18
class ConfigProviderTest extends TestCase
19
{
20
    private $configBuilder;
21
22
    protected function setUp(): void
23
    {
24
        $this->configBuilder = $this->prophesize(ConfigBuilderInterface::class);
25
    }
26
27
    public function testGet(): void
28
    {
29
        $menu = $this->prophesize(ItemInterface::class);
30
31
        $this->configBuilder->buildMenu(['name' => 'foo'], ['a' => 'b'])->willReturn($menu);
32
33
        $configProvider = new ConfigProvider($this->configBuilder->reveal(), [
34
            'foo' => ['name' => 'foo'],
35
            'bar' => ['name' => 'bar'],
36
        ]);
37
        $this->assertSame($menu->reveal(), $configProvider->get('foo', ['a' => 'b']));
38
    }
39
40 View Code Duplication
    public function testGetDoesNotExist(): void
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
41
    {
42
        $this->expectException(InvalidArgumentException::class);
43
44
        $configProvider = new ConfigProvider($this->configBuilder->reveal(), [
45
            'foo' => ['name' => 'foo'],
46
            'bar' => ['name' => 'bar'],
47
        ]);
48
        $configProvider->get('baz');
49
    }
50
51 View Code Duplication
    public function testHas(): void
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
52
    {
53
        $configProvider = new ConfigProvider($this->configBuilder->reveal(), [
54
            'foo' => ['name' => 'foo'],
55
            'bar' => ['name' => 'bar'],
56
        ]);
57
58
        $this->assertTrue($configProvider->has('foo'));
59
    }
60
61 View Code Duplication
    public function testHasNot(): void
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
62
    {
63
        $configProvider = new ConfigProvider($this->configBuilder->reveal(), [
64
            'foo' => ['name' => 'foo'],
65
            'bar' => ['name' => 'bar'],
66
        ]);
67
68
        $this->assertFalse($configProvider->has('baz'));
69
    }
70
}
71