|
@@ 478-498 (lines=21) @@
|
| 475 |
|
$this->assertSame(10, $this->parameterResolver->resolveMaxPerPage()); |
| 476 |
|
} |
| 477 |
|
|
| 478 |
|
public function testResolveMaxPerPageDefault() |
| 479 |
|
{ |
| 480 |
|
$this->requestStack |
| 481 |
|
->expects($this->exactly(2)) |
| 482 |
|
->method('getMasterRequest') |
| 483 |
|
->will($this->returnValue($request = $this->createRequestMock())); |
| 484 |
|
|
| 485 |
|
$request->attributes |
| 486 |
|
->expects($this->once()) |
| 487 |
|
->method('get') |
| 488 |
|
->with($this->identicalTo('_lug_max_per_page'), $this->identicalTo($maxPerPage = 10)) |
| 489 |
|
->will($this->returnValue($maxPerPage)); |
| 490 |
|
|
| 491 |
|
$request |
| 492 |
|
->expects($this->once()) |
| 493 |
|
->method('get') |
| 494 |
|
->with($this->identicalTo('limit'), $this->identicalTo($maxPerPage)) |
| 495 |
|
->will($this->returnValue($maxPerPage)); |
| 496 |
|
|
| 497 |
|
$this->assertSame($maxPerPage, $this->parameterResolver->resolveMaxPerPage()); |
| 498 |
|
} |
| 499 |
|
|
| 500 |
|
public function testResolveMaxPerPageExplicit() |
| 501 |
|
{ |
|
@@ 500-520 (lines=21) @@
|
| 497 |
|
$this->assertSame($maxPerPage, $this->parameterResolver->resolveMaxPerPage()); |
| 498 |
|
} |
| 499 |
|
|
| 500 |
|
public function testResolveMaxPerPageExplicit() |
| 501 |
|
{ |
| 502 |
|
$this->requestStack |
| 503 |
|
->expects($this->exactly(2)) |
| 504 |
|
->method('getMasterRequest') |
| 505 |
|
->will($this->returnValue($request = $this->createRequestMock())); |
| 506 |
|
|
| 507 |
|
$request->attributes |
| 508 |
|
->expects($this->once()) |
| 509 |
|
->method('get') |
| 510 |
|
->with($this->identicalTo('_lug_max_per_page'), $this->identicalTo(10)) |
| 511 |
|
->will($this->returnValue($maxPerPage = 5)); |
| 512 |
|
|
| 513 |
|
$request |
| 514 |
|
->expects($this->once()) |
| 515 |
|
->method('get') |
| 516 |
|
->with($this->identicalTo('limit'), $this->identicalTo($maxPerPage)) |
| 517 |
|
->will($this->returnValue($maxPerPage)); |
| 518 |
|
|
| 519 |
|
$this->assertSame($maxPerPage, $this->parameterResolver->resolveMaxPerPage()); |
| 520 |
|
} |
| 521 |
|
|
| 522 |
|
public function testResolveMaxPerPageDynamic() |
| 523 |
|
{ |