Passed
Push — master ( 979f6d...757493 )
by US
08:39 queued 11s
created

ProductAttributesByTaxonQueryBuilderSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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\ProductAttributesByTaxonQueryBuilder;
16
use BitBag\SyliusElasticsearchPlugin\QueryBuilder\QueryBuilderInterface;
17
use Elastica\Query\AbstractQuery;
18
use Elastica\Query\BoolQuery;
19
use PhpSpec\ObjectBehavior;
20
21
final class ProductAttributesByTaxonQueryBuilderSpec extends ObjectBehavior
22
{
23
    function let(QueryBuilderInterface $hasTaxonQueryBuilder): void
24
    {
25
        $this->beConstructedWith($hasTaxonQueryBuilder);
26
    }
27
28
    function it_is_initializable(): void
29
    {
30
        $this->shouldHaveType(ProductAttributesByTaxonQueryBuilder::class);
31
    }
32
33
    function it_implements_query_builder_interface(): void
34
    {
35
        $this->shouldHaveType(QueryBuilderInterface::class);
36
    }
37
38
    function it_builds_query(
39
        QueryBuilderInterface $hasTaxonQueryBuilder,
40
        AbstractQuery $taxonQuery
41
    ): void {
42
        $hasTaxonQueryBuilder->buildQuery([])->willReturn($taxonQuery);
43
44
        $this->buildQuery([])->shouldBeAnInstanceOf(BoolQuery::class);
45
    }
46
}
47