Passed
Pull Request — master (#51)
by Konrad
06:30 queued 02:46
created

ItemsResponseSpec::it_can_add_items()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file has been created by developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * another great project.
7
 * You can find more information about us on https://bitbag.shop and write us
8
 * an email on [email protected].
9
 */
10
11
declare(strict_types=1);
12
13
namespace spec\BitBag\SyliusElasticsearchPlugin\Controller\Response;
14
15
use BitBag\SyliusElasticsearchPlugin\Controller\Response\DTO\Item;
16
use PhpSpec\ObjectBehavior;
17
18
final class ItemsResponseSpec extends ObjectBehavior
19
{
20
    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...
21
    {
22
        $this->beConstructedThrough('createEmpty');
23
    }
24
25
    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...
26
    {
27
        $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

27
        $this->/** @scrutinizer ignore-call */ 
28
               addItem(new Item(
Loading history...
28
            'Super cars',
29
            'McLaren F1',
30
            'Very quirky super-car',
31
            '/mc-laren/f1',
32
            '$22,000,000.00',
33
            ''
34
        ));
35
36
        $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

36
        $this->/** @scrutinizer ignore-call */ 
37
               all()->shouldHaveCount(1);
Loading history...
37
    }
38
39
    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...
40
    {
41
        $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

41
        $this->/** @scrutinizer ignore-call */ 
42
               toArray()->shouldBeArray();
Loading history...
42
    }
43
}
44