@@ 247-270 (lines=24) @@ | ||
244 | ||
245 | } |
|
246 | ||
247 | public function testMin() { |
|
248 | $datas = [ |
|
249 | [ |
|
250 | "name" => "foo", |
|
251 | "value" => 10 |
|
252 | ], |
|
253 | [ |
|
254 | "name" => "bar", |
|
255 | "value" => 5 |
|
256 | ], |
|
257 | [ |
|
258 | "name" => "foo", |
|
259 | "value" => 30 |
|
260 | ] |
|
261 | ]; |
|
262 | ||
263 | $this->repository->insertMany($datas); |
|
264 | ||
265 | $result = $this->repository->min("value"); |
|
266 | $this->assertEquals(5, $result); |
|
267 | ||
268 | $result = $this->repository->min("value", ["name" => "foo"]); |
|
269 | $this->assertEquals(10, $result); |
|
270 | } |
|
271 | ||
272 | public function testMax() { |
|
273 | $datas = [ |
|
@@ 272-295 (lines=24) @@ | ||
269 | $this->assertEquals(10, $result); |
|
270 | } |
|
271 | ||
272 | public function testMax() { |
|
273 | $datas = [ |
|
274 | [ |
|
275 | "name" => "foo", |
|
276 | "value" => 10 |
|
277 | ], |
|
278 | [ |
|
279 | "name" => "bar", |
|
280 | "value" => 5 |
|
281 | ], |
|
282 | [ |
|
283 | "name" => "foo", |
|
284 | "value" => 30 |
|
285 | ] |
|
286 | ]; |
|
287 | ||
288 | $this->repository->insertMany($datas); |
|
289 | ||
290 | $result = $this->repository->max("value"); |
|
291 | $this->assertEquals(30, $result); |
|
292 | ||
293 | $result = $this->repository->max("value", ["name" => "bar"]); |
|
294 | $this->assertEquals(5, $result); |
|
295 | } |
|
296 | ||
297 | } |