Completed
Pull Request — master (#51)
by Konrad
03:32
created

ItemsResponseSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace spec\BitBag\SyliusElasticsearchPlugin\Controller\Response;
6
7
use BitBag\SyliusElasticsearchPlugin\Controller\Response\DTO\Item;
8
use PhpSpec\ObjectBehavior;
9
10
final class ItemsResponseSpec extends ObjectBehavior
11
{
12
    function let(): void
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->beConstructedThrough('createEmpty');
15
    }
16
17
    function it_can_add_items(): void
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...
18
    {
19
        $this->addItem(new Item(
0 ignored issues
show
Bug introduced by
The method addItem() does not exist on spec\BitBag\SyliusElasti...ponse\ItemsResponseSpec. 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
               addItem(new Item(
Loading history...
20
            'Super cars',
21
            'McLaren F1',
22
            'Very quirky super-car',
23
            '/mc-laren/f1',
24
            '$22,000,000.00',
25
            ''
26
        ));
27
28
        $this->all()->shouldHaveCount(1);
0 ignored issues
show
Bug introduced by
The method all() does not exist on spec\BitBag\SyliusElasti...ponse\ItemsResponseSpec. 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

28
        $this->/** @scrutinizer ignore-call */ 
29
               all()->shouldHaveCount(1);
Loading history...
29
    }
30
31
    function it_returns_an_array(): void
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...
32
    {
33
        $this->toArray()->shouldBeArray();
0 ignored issues
show
Bug introduced by
The method toArray() does not exist on spec\BitBag\SyliusElasti...ponse\ItemsResponseSpec. 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

33
        $this->/** @scrutinizer ignore-call */ 
34
               toArray()->shouldBeArray();
Loading history...
34
    }
35
}
36