|
@@ 26-35 (lines=10) @@
|
| 23 |
|
$this->shouldHaveType('Happyr\DoctrineSpecification\Specification\Specification'); |
| 24 |
|
} |
| 25 |
|
|
| 26 |
|
public function it_surrounds_with_wildcards_when_using_contains(QueryBuilder $qb, ArrayCollection $parameters) |
| 27 |
|
{ |
| 28 |
|
$this->beConstructedWith($this->field, $this->value, Like::CONTAINS, 'dqlAlias'); |
| 29 |
|
$qb->getParameters()->willReturn($parameters); |
| 30 |
|
$parameters->count()->willReturn(1); |
| 31 |
|
|
| 32 |
|
$qb->setParameter('comparison_1', '%bar%')->shouldBeCalled(); |
| 33 |
|
|
| 34 |
|
$this->match($qb, null); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
public function it_starts_with_wildcard_when_using_ends_with(QueryBuilder $qb, ArrayCollection $parameters) |
| 38 |
|
{ |
|
@@ 37-46 (lines=10) @@
|
| 34 |
|
$this->match($qb, null); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
public function it_starts_with_wildcard_when_using_ends_with(QueryBuilder $qb, ArrayCollection $parameters) |
| 38 |
|
{ |
| 39 |
|
$this->beConstructedWith($this->field, $this->value, Like::ENDS_WITH, 'dqlAlias'); |
| 40 |
|
$qb->getParameters()->willReturn($parameters); |
| 41 |
|
$parameters->count()->willReturn(1); |
| 42 |
|
|
| 43 |
|
$qb->setParameter('comparison_1', '%bar')->shouldBeCalled(); |
| 44 |
|
|
| 45 |
|
$this->match($qb, null); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
public function it_ends_with_wildcard_when_using_starts_with(QueryBuilder $qb, ArrayCollection $parameters) |
| 49 |
|
{ |
|
@@ 48-57 (lines=10) @@
|
| 45 |
|
$this->match($qb, null); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
public function it_ends_with_wildcard_when_using_starts_with(QueryBuilder $qb, ArrayCollection $parameters) |
| 49 |
|
{ |
| 50 |
|
$this->beConstructedWith($this->field, $this->value, Like::STARTS_WITH, 'dqlAlias'); |
| 51 |
|
$qb->getParameters()->willReturn($parameters); |
| 52 |
|
$parameters->count()->willReturn(1); |
| 53 |
|
|
| 54 |
|
$qb->setParameter('comparison_1', 'bar%')->shouldBeCalled(); |
| 55 |
|
|
| 56 |
|
$this->match($qb, null); |
| 57 |
|
} |
| 58 |
|
} |
| 59 |
|
|