it_collects_data_from_dictionaries()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 14
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 25
rs 9.7998
1
<?php
2
3
declare(strict_types=1);
4
5
namespace spec\Knp\DictionaryBundle\DataCollector;
6
7
use Knp\DictionaryBundle\DataCollector\DictionaryDataCollector;
8
use PhpSpec\ObjectBehavior;
9
10
final class DictionaryDataCollectorSpec extends ObjectBehavior
11
{
12
    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...
13
    {
14
        $this->shouldHaveType(DictionaryDataCollector::class);
15
    }
16
17
    function it_collects_data_from_dictionaries()
18
    {
19
        $this->addDictionary('foo', ['key1', 'key2'], ['value1', 'value2']);
0 ignored issues
show
Bug introduced by
The method addDictionary() does not exist on spec\Knp\DictionaryBundl...ionaryDataCollectorSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        $this->/** @scrutinizer ignore-call */ 
20
               addDictionary('foo', ['key1', 'key2'], ['value1', 'value2']);
Loading history...
20
        $this->addDictionary('foo', ['key1', 'key2'], ['value1', 'value2']);
21
        $this->addDictionary('bar', ['keyA', 'keyB'], ['valueA', 'valueB']);
22
23
        $this->getDictionaries()->shouldIterateLike([
0 ignored issues
show
Bug introduced by
The method getDictionaries() does not exist on spec\Knp\DictionaryBundl...ionaryDataCollectorSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        $this->/** @scrutinizer ignore-call */ 
24
               getDictionaries()->shouldIterateLike([
Loading history...
24
            'foo' => [
25
                [
26
                    'key'   => 'key1',
27
                    'value' => 'value1',
28
                ],
29
                [
30
                    'key'   => 'key2',
31
                    'value' => 'value2',
32
                ],
33
            ],
34
            'bar' => [
35
                [
36
                    'key'   => 'keyA',
37
                    'value' => 'valueA',
38
                ],
39
                [
40
                    'key'   => 'keyB',
41
                    'value' => 'valueB',
42
                ],
43
            ],
44
        ]);
45
    }
46
47
    function it_has_a_name()
48
    {
49
        $this->getName()->shouldReturn('dictionary');
0 ignored issues
show
Bug introduced by
The method getName() does not exist on spec\Knp\DictionaryBundl...ionaryDataCollectorSpec. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

49
        $this->/** @scrutinizer ignore-call */ 
50
               getName()->shouldReturn('dictionary');
Loading history...
50
    }
51
}
52