|
@@ 448-471 (lines=24) @@
|
| 445 |
|
$this->assertEmpty($this->parameterResolver->resolveLocationRouteParameters(new \stdClass())); |
| 446 |
|
} |
| 447 |
|
|
| 448 |
|
public function testResolveLocationRouteParametersExplicit() |
| 449 |
|
{ |
| 450 |
|
$this->requestStack |
| 451 |
|
->expects($this->once()) |
| 452 |
|
->method('getMasterRequest') |
| 453 |
|
->will($this->returnValue($request = $this->createRequestMock())); |
| 454 |
|
|
| 455 |
|
$request->attributes |
| 456 |
|
->expects($this->once()) |
| 457 |
|
->method('get') |
| 458 |
|
->with($this->identicalTo('_lug_location_route_parameters'), $this->identicalTo([])) |
| 459 |
|
->will($this->returnValue([$parameter = 'id'])); |
| 460 |
|
|
| 461 |
|
$object = new \stdClass(); |
| 462 |
|
$object->{$parameter} = $value = 1; |
| 463 |
|
|
| 464 |
|
$this->propertyAccessor |
| 465 |
|
->expects($this->once()) |
| 466 |
|
->method('getValue') |
| 467 |
|
->with($this->identicalTo($object), $this->identicalTo($parameter)) |
| 468 |
|
->will($this->returnValue($value)); |
| 469 |
|
|
| 470 |
|
$this->assertSame([$parameter => $value], $this->parameterResolver->resolveLocationRouteParameters($object)); |
| 471 |
|
} |
| 472 |
|
|
| 473 |
|
public function testResolveMaxPerPageWithoutRequest() |
| 474 |
|
{ |
|
@@ 660-683 (lines=24) @@
|
| 657 |
|
$this->assertEmpty($this->parameterResolver->resolveRedirectRouteParameters(new \stdClass())); |
| 658 |
|
} |
| 659 |
|
|
| 660 |
|
public function testResolveRedirectRouteParametersExplicit() |
| 661 |
|
{ |
| 662 |
|
$this->requestStack |
| 663 |
|
->expects($this->once()) |
| 664 |
|
->method('getMasterRequest') |
| 665 |
|
->will($this->returnValue($request = $this->createRequestMock())); |
| 666 |
|
|
| 667 |
|
$request->attributes |
| 668 |
|
->expects($this->once()) |
| 669 |
|
->method('get') |
| 670 |
|
->with($this->identicalTo('_lug_redirect_route_parameters'), $this->identicalTo([])) |
| 671 |
|
->will($this->returnValue([$parameter = 'id'])); |
| 672 |
|
|
| 673 |
|
$object = new \stdClass(); |
| 674 |
|
$object->{$parameter} = $value = 1; |
| 675 |
|
|
| 676 |
|
$this->propertyAccessor |
| 677 |
|
->expects($this->once()) |
| 678 |
|
->method('getValue') |
| 679 |
|
->with($this->identicalTo($object), $this->identicalTo($parameter)) |
| 680 |
|
->will($this->returnValue($value)); |
| 681 |
|
|
| 682 |
|
$this->assertSame([$parameter => $value], $this->parameterResolver->resolveRedirectRouteParameters($object)); |
| 683 |
|
} |
| 684 |
|
|
| 685 |
|
public function testResolveRedirectRouteParametersForwardParameters() |
| 686 |
|
{ |