@@ 38-47 (lines=10) @@ | ||
35 | $this->shouldHaveType(Specification::class); |
|
36 | } |
|
37 | ||
38 | public function it_surrounds_with_wildcards_when_using_contains(QueryBuilder $qb, ArrayCollection $parameters) |
|
39 | { |
|
40 | $this->beConstructedWith($this->field, $this->value, Like::CONTAINS, 'dqlAlias'); |
|
41 | $qb->getParameters()->willReturn($parameters); |
|
42 | $parameters->count()->willReturn(1); |
|
43 | ||
44 | $qb->setParameter('comparison_1', '%bar%')->shouldBeCalled(); |
|
45 | ||
46 | $this->match($qb, null); |
|
47 | } |
|
48 | ||
49 | public function it_starts_with_wildcard_when_using_ends_with(QueryBuilder $qb, ArrayCollection $parameters) |
|
50 | { |
|
@@ 49-58 (lines=10) @@ | ||
46 | $this->match($qb, null); |
|
47 | } |
|
48 | ||
49 | public function it_starts_with_wildcard_when_using_ends_with(QueryBuilder $qb, ArrayCollection $parameters) |
|
50 | { |
|
51 | $this->beConstructedWith($this->field, $this->value, Like::ENDS_WITH, 'dqlAlias'); |
|
52 | $qb->getParameters()->willReturn($parameters); |
|
53 | $parameters->count()->willReturn(1); |
|
54 | ||
55 | $qb->setParameter('comparison_1', '%bar')->shouldBeCalled(); |
|
56 | ||
57 | $this->match($qb, null); |
|
58 | } |
|
59 | ||
60 | public function it_ends_with_wildcard_when_using_starts_with(QueryBuilder $qb, ArrayCollection $parameters) |
|
61 | { |
|
@@ 60-69 (lines=10) @@ | ||
57 | $this->match($qb, null); |
|
58 | } |
|
59 | ||
60 | public function it_ends_with_wildcard_when_using_starts_with(QueryBuilder $qb, ArrayCollection $parameters) |
|
61 | { |
|
62 | $this->beConstructedWith($this->field, $this->value, Like::STARTS_WITH, 'dqlAlias'); |
|
63 | $qb->getParameters()->willReturn($parameters); |
|
64 | $parameters->count()->willReturn(1); |
|
65 | ||
66 | $qb->setParameter('comparison_1', 'bar%')->shouldBeCalled(); |
|
67 | ||
68 | $this->match($qb, null); |
|
69 | } |
|
70 | } |
|
71 |