Total Complexity | 6 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | final class AttributeFacetSpec extends ObjectBehavior |
||
18 | { |
||
19 | function let( |
||
|
|||
20 | ConcatedNameResolverInterface $attributeNameResolver, |
||
21 | RepositoryInterface $attributeRepository |
||
22 | ): void { |
||
23 | $attributeNameResolver->resolvePropertyName('attribute_code')->willReturn('attribute_attribute_code'); |
||
24 | $this->beConstructedWith($attributeNameResolver, $attributeRepository, 'attribute_code'); |
||
25 | } |
||
26 | |||
27 | function it_is_initializable(): void |
||
30 | } |
||
31 | |||
32 | function it_implements_facet_interface(): void |
||
33 | { |
||
34 | $this->shouldHaveType(FacetInterface::class); |
||
35 | } |
||
36 | |||
37 | function it_returns_terms_aggregation(): void |
||
38 | { |
||
39 | $expectedAggregation = new Terms(''); |
||
40 | $expectedAggregation->setField('attribute_attribute_code.keyword'); |
||
41 | |||
42 | $this->getAggregation()->shouldBeLike($expectedAggregation); |
||
43 | } |
||
44 | |||
45 | function it_returns_terms_query(): void |
||
46 | { |
||
47 | $selectedBuckets = ['selected_value']; |
||
48 | $expectedQuery = new \Elastica\Query\Terms('attribute_attribute_code.keyword', $selectedBuckets); |
||
49 | |||
50 | $this->getQuery($selectedBuckets)->shouldBeLike($expectedQuery); |
||
51 | } |
||
52 | |||
53 | function it_returns_bucket_label_(): void |
||
56 | } |
||
57 | } |
||
58 |
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.