Passed
Pull Request — master (#157)
by
unknown
07:07
created

it_implements_query_builder_interface()   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
/*
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\QueryBuilder;
14
15
use BitBag\SyliusElasticsearchPlugin\QueryBuilder\HasAttributesQueryBuilder;
16
use BitBag\SyliusElasticsearchPlugin\QueryBuilder\QueryBuilderInterface;
17
use Elastica\Query\BoolQuery;
18
use PhpSpec\ObjectBehavior;
19
20
final class HasAttributesQueryBuilderSpec extends ObjectBehavior
21
{
22
    function it_is_initializable(): 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...
23
    {
24
        $this->shouldHaveType(HasAttributesQueryBuilder::class);
25
    }
26
27
    function it_implements_query_builder_interface(): void
28
    {
29
        $this->shouldHaveType(QueryBuilderInterface::class);
30
    }
31
32
    function it_builds_query(): void
33
    {
34
        $this->buildQuery([
0 ignored issues
show
Bug introduced by
The method buildQuery() does not exist on spec\BitBag\SyliusElasti...ributesQueryBuilderSpec. 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

34
        $this->/** @scrutinizer ignore-call */ 
35
               buildQuery([
Loading history...
35
            'attribute_values' => ['XL', 'L'],
36
            'attribute' => 'size',
37
        ])->shouldBeAnInstanceOf(BoolQuery::class);
38
    }
39
}
40