tests/Filter/EqualsSpec.php 1 location
|
@@ 68-79 (lines=12) @@
|
65 |
|
$this->getFilter($qb, 'root')->shouldReturn('user.age = :comparison_10'); |
66 |
|
} |
67 |
|
|
68 |
|
public function it_filter_array_collection(): void |
69 |
|
{ |
70 |
|
$this->beConstructedWith('gender', 'F', null); |
71 |
|
|
72 |
|
$players = [ |
73 |
|
['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500], |
74 |
|
['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230], |
75 |
|
['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001], |
76 |
|
]; |
77 |
|
|
78 |
|
$this->filterCollection($players)->shouldYield([$players[2]]); |
79 |
|
} |
80 |
|
|
81 |
|
public function it_filter_object_collection(): void |
82 |
|
{ |
tests/Filter/GreaterOrEqualThanSpec.php 1 location
|
@@ 68-79 (lines=12) @@
|
65 |
|
$this->getFilter($qb, 'root')->shouldReturn('user.age >= :comparison_10'); |
66 |
|
} |
67 |
|
|
68 |
|
public function it_filter_array_collection(): void |
69 |
|
{ |
70 |
|
$this->beConstructedWith('points', 9000, null); |
71 |
|
|
72 |
|
$players = [ |
73 |
|
['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500], |
74 |
|
['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230], |
75 |
|
['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9000], |
76 |
|
]; |
77 |
|
|
78 |
|
$this->filterCollection($players)->shouldYield([$players[2]]); |
79 |
|
} |
80 |
|
|
81 |
|
public function it_filter_object_collection(): void |
82 |
|
{ |
tests/Filter/GreaterThanSpec.php 1 location
|
@@ 68-79 (lines=12) @@
|
65 |
|
$this->getFilter($qb, 'root')->shouldReturn('user.age > :comparison_10'); |
66 |
|
} |
67 |
|
|
68 |
|
public function it_filter_array_collection(): void |
69 |
|
{ |
70 |
|
$this->beConstructedWith('points', 9000, null); |
71 |
|
|
72 |
|
$players = [ |
73 |
|
['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500], |
74 |
|
['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230], |
75 |
|
['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001], |
76 |
|
]; |
77 |
|
|
78 |
|
$this->filterCollection($players)->shouldYield([$players[2]]); |
79 |
|
} |
80 |
|
|
81 |
|
public function it_filter_object_collection(): void |
82 |
|
{ |
tests/Filter/InstanceOfXSpec.php 1 location
|
@@ 72-83 (lines=12) @@
|
69 |
|
$this->getFilter($qb, 'root')->shouldReturn('o INSTANCE OF My\Model'); |
70 |
|
} |
71 |
|
|
72 |
|
public function it_filter_array_collection(): void |
73 |
|
{ |
74 |
|
$this->beConstructedWith(Player::class, null); |
75 |
|
|
76 |
|
$players = [ |
77 |
|
['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500], |
78 |
|
['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230], |
79 |
|
['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001], |
80 |
|
]; |
81 |
|
|
82 |
|
$this->filterCollection($players)->shouldYield([]); |
83 |
|
} |
84 |
|
|
85 |
|
public function it_filter_object_collection(): void |
86 |
|
{ |
tests/Filter/IsEmptySpec.php 1 location
|
@@ 63-74 (lines=12) @@
|
60 |
|
$this->getFilter($qb, 'root')->shouldReturn(sprintf('user.%s IS EMPTY', $this->field)); |
61 |
|
} |
62 |
|
|
63 |
|
public function it_filter_array_collection(): void |
64 |
|
{ |
65 |
|
$this->beConstructedWith('points', null); |
66 |
|
|
67 |
|
$players = [ |
68 |
|
['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500], |
69 |
|
['pseudo' => 'Moe', 'gender' => 'M', 'points' => null], |
70 |
|
['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001], |
71 |
|
]; |
72 |
|
|
73 |
|
$this->filterCollection($players)->shouldYield([$players[1]]); |
74 |
|
} |
75 |
|
|
76 |
|
public function it_filter_object_collection(): void |
77 |
|
{ |
tests/Filter/IsNotNullSpec.php 1 location
|
@@ 69-80 (lines=12) @@
|
66 |
|
$this->getFilter($qb, 'root'); |
67 |
|
} |
68 |
|
|
69 |
|
public function it_filter_array_collection(): void |
70 |
|
{ |
71 |
|
$this->beConstructedWith('points', null); |
72 |
|
|
73 |
|
$players = [ |
74 |
|
['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500], |
75 |
|
['pseudo' => 'Moe', 'gender' => 'M', 'points' => null], |
76 |
|
['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001], |
77 |
|
]; |
78 |
|
|
79 |
|
$this->filterCollection($players)->shouldYield([$players[0], $players[2]]); |
80 |
|
} |
81 |
|
|
82 |
|
public function it_filter_object_collection(): void |
83 |
|
{ |
tests/Filter/IsNullSpec.php 1 location
|
@@ 69-80 (lines=12) @@
|
66 |
|
$this->getFilter($qb, 'root'); |
67 |
|
} |
68 |
|
|
69 |
|
public function it_filter_array_collection(): void |
70 |
|
{ |
71 |
|
$this->beConstructedWith('points', null); |
72 |
|
|
73 |
|
$players = [ |
74 |
|
['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500], |
75 |
|
['pseudo' => 'Moe', 'gender' => 'M', 'points' => null], |
76 |
|
['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001], |
77 |
|
]; |
78 |
|
|
79 |
|
$this->filterCollection($players)->shouldYield([$players[1]]); |
80 |
|
} |
81 |
|
|
82 |
|
public function it_filter_object_collection(): void |
83 |
|
{ |
tests/Filter/LessThanSpec.php 1 location
|
@@ 68-79 (lines=12) @@
|
65 |
|
$this->getFilter($qb, 'root')->shouldReturn('user.age < :comparison_10'); |
66 |
|
} |
67 |
|
|
68 |
|
public function it_filter_array_collection(): void |
69 |
|
{ |
70 |
|
$this->beConstructedWith('points', 2500, null); |
71 |
|
|
72 |
|
$players = [ |
73 |
|
['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500], |
74 |
|
['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230], |
75 |
|
['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001], |
76 |
|
]; |
77 |
|
|
78 |
|
$this->filterCollection($players)->shouldYield([$players[1]]); |
79 |
|
} |
80 |
|
|
81 |
|
public function it_filter_object_collection(): void |
82 |
|
{ |
tests/Filter/LikeSpec.php 1 location
|
@@ 132-143 (lines=12) @@
|
129 |
|
$this->getFilter($qb, 'root'); |
130 |
|
} |
131 |
|
|
132 |
|
public function it_filter_array_collection_starts_with(): void |
133 |
|
{ |
134 |
|
$this->beConstructedWith('pseudo', 'M', Like::STARTS_WITH, null); |
135 |
|
|
136 |
|
$players = [ |
137 |
|
['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500], |
138 |
|
['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230], |
139 |
|
['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001], |
140 |
|
]; |
141 |
|
|
142 |
|
$this->filterCollection($players)->shouldYield([$players[1]]); |
143 |
|
} |
144 |
|
|
145 |
|
public function it_filter_array_collection_ends_with(): void |
146 |
|
{ |
tests/Filter/NotEqualsSpec.php 1 location
|
@@ 68-79 (lines=12) @@
|
65 |
|
$this->getFilter($qb, 'root')->shouldReturn('user.age <> :comparison_10'); |
66 |
|
} |
67 |
|
|
68 |
|
public function it_filter_array_collection(): void |
69 |
|
{ |
70 |
|
$this->beConstructedWith('gender', 'M', null); |
71 |
|
|
72 |
|
$players = [ |
73 |
|
['pseudo' => 'Joe', 'gender' => 'M', 'points' => 2500], |
74 |
|
['pseudo' => 'Moe', 'gender' => 'M', 'points' => 1230], |
75 |
|
['pseudo' => 'Alice', 'gender' => 'F', 'points' => 9001], |
76 |
|
]; |
77 |
|
|
78 |
|
$this->filterCollection($players)->shouldYield([$players[2]]); |
79 |
|
} |
80 |
|
|
81 |
|
public function it_filter_object_collection(): void |
82 |
|
{ |