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
|
|||
21 | { |
||
22 | $this->beConstructedThrough('createEmpty'); |
||
23 | } |
||
24 | |||
25 | function it_can_add_items(): void |
||
0 ignored issues
–
show
|
|||
26 | { |
||
27 | $this->addItem(new Item( |
||
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); |
||
37 | } |
||
38 | |||
39 | function it_returns_an_array(): void |
||
0 ignored issues
–
show
|
|||
40 | { |
||
41 | $this->toArray()->shouldBeArray(); |
||
42 | } |
||
43 | } |
||
44 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.