Passed
Pull Request — master (#193)
by Pierre
02:59
created

CombinedSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 21
dl 0
loc 48
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 3 1
A getExpectedName() 0 3 1
A getExpectedResult() 0 6 1
A let() 0 22 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace spec\Knp\DictionaryBundle\Dictionary;
6
7
use Knp\DictionaryBundle\Dictionary;
8
use Knp\DictionaryBundle\Dictionary\Combined;
9
use PhpSpec\ObjectBehavior;
10
11
final class CombinedSpec extends ObjectBehavior
12
{
13
    use DictionaryBehavior;
14
15
    function let()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
16
    {
17
        $this->beConstructedWith(
18
            'combined_dictionary',
19
            new Dictionary\Simple(
20
                'dictionary1',
21
                [
22
                    'foo' => 1,
23
                    'bar' => 2,
24
                ]
25
            ),
26
            new Dictionary\Simple(
27
                'dictionary2',
28
                [
29
                    'bar' => 3,
30
                    'baz' => 4,
31
                ]
32
            ),
33
            new Dictionary\Simple(
34
                'dictionary3',
35
                [
36
                    'baz' => 5,
37
                ]
38
            ),
39
        );
40
    }
41
42
    function it_is_initializable()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
43
    {
44
        $this->shouldHaveType(Combined::class);
45
    }
46
47
    protected function getExpectedResult(): array
48
    {
49
        return [
50
            'foo' => 1,
51
            'bar' => 3,
52
            'baz' => 5,
53
        ];
54
    }
55
56
    protected function getExpectedName(): string
57
    {
58
        return 'combined_dictionary';
59
    }
60
}
61