| Total Complexity | 3 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | final class NamedProductsFinderSpec extends ObjectBehavior |
||
| 22 | { |
||
| 23 | function let( |
||
| 24 | QueryBuilderInterface $productsByPartialNameQueryBuilder, |
||
| 25 | FinderInterface $productsFinder |
||
| 26 | ): void { |
||
| 27 | $this->beConstructedWith($productsByPartialNameQueryBuilder, $productsFinder); |
||
| 28 | } |
||
| 29 | |||
| 30 | function it_is_a_named_products_finder(): void |
||
| 31 | { |
||
| 32 | $this->shouldImplement(NamedProductsFinderInterface::class); |
||
| 33 | } |
||
| 34 | |||
| 35 | function it_finds_by_partial_name_of_products( |
||
| 36 | QueryBuilderInterface $productsByPartialNameQueryBuilder, |
||
| 37 | FinderInterface $productsFinder, |
||
| 38 | AbstractQuery $query |
||
| 39 | ): void { |
||
| 40 | $productsByPartialNameQueryBuilder->buildQuery(['name' => 'part'])->willReturn($query); |
||
| 41 | |||
| 42 | $productsFinder->find($query)->willReturn([]); |
||
| 43 | |||
| 44 | $this->findByNamePart('part')->shouldBeArray(); |
||
| 45 | } |
||
| 47 |