Passed
Pull Request — master (#193)
by Pierre
10:56
created

SimpleSpec::it_access_to_value_like_an_array()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace spec\Knp\DictionaryBundle\Dictionary;
6
7
use Knp\DictionaryBundle\Dictionary\Simple;
8
use PhpSpec\ObjectBehavior;
9
10
final class SimpleSpec extends ObjectBehavior
11
{
12
    use DictionaryBehavior;
13
14
    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...
15
    {
16
        $this->beConstructedWith('foo', [
17
            'foo' => 0,
18
            'bar' => 1,
19
            'baz' => 2,
20
        ]);
21
    }
22
23
    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...
24
    {
25
        $this->shouldHaveType(Simple::class);
26
    }
27
28
    protected function getExpectedResult(): array
29
    {
30
        return [
31
            'foo' => 0,
32
            'bar' => 1,
33
            'baz' => 2,
34
        ];
35
    }
36
37
    protected function getExpectedName(): string
38
    {
39
        return 'foo';
40
    }
41
}
42