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

CombinedSpec::it_sums_the_count_of_elements()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
c 0
b 0
f 0
nc 1
nop 3
dl 0
loc 19
rs 9.9
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