@@ 484-507 (lines=24) @@ | ||
481 | $this->assertEmpty($this->parameterResolver->resolveLocationRouteParameters(new \stdClass())); |
|
482 | } |
|
483 | ||
484 | public function testResolveLocationRouteParametersExplicit() |
|
485 | { |
|
486 | $this->requestStack |
|
487 | ->expects($this->once()) |
|
488 | ->method('getMasterRequest') |
|
489 | ->will($this->returnValue($request = $this->createRequestMock())); |
|
490 | ||
491 | $request->attributes |
|
492 | ->expects($this->once()) |
|
493 | ->method('get') |
|
494 | ->with($this->identicalTo('_lug_location_route_parameters'), $this->identicalTo([])) |
|
495 | ->will($this->returnValue([$parameter = 'id'])); |
|
496 | ||
497 | $object = new \stdClass(); |
|
498 | $object->{$parameter} = $value = 1; |
|
499 | ||
500 | $this->propertyAccessor |
|
501 | ->expects($this->once()) |
|
502 | ->method('getValue') |
|
503 | ->with($this->identicalTo($object), $this->identicalTo($parameter)) |
|
504 | ->will($this->returnValue($value)); |
|
505 | ||
506 | $this->assertSame([$parameter => $value], $this->parameterResolver->resolveLocationRouteParameters($object)); |
|
507 | } |
|
508 | ||
509 | public function testResolveMaxPerPageWithoutRequest() |
|
510 | { |
|
@@ 618-641 (lines=24) @@ | ||
615 | $this->assertEmpty($this->parameterResolver->resolveRedirectRouteParameters(new \stdClass())); |
|
616 | } |
|
617 | ||
618 | public function testResolveRedirectRouteParametersExplicit() |
|
619 | { |
|
620 | $this->requestStack |
|
621 | ->expects($this->once()) |
|
622 | ->method('getMasterRequest') |
|
623 | ->will($this->returnValue($request = $this->createRequestMock())); |
|
624 | ||
625 | $request->attributes |
|
626 | ->expects($this->once()) |
|
627 | ->method('get') |
|
628 | ->with($this->identicalTo('_lug_redirect_route_parameters'), $this->identicalTo([])) |
|
629 | ->will($this->returnValue([$parameter = 'id'])); |
|
630 | ||
631 | $object = new \stdClass(); |
|
632 | $object->{$parameter} = $value = 1; |
|
633 | ||
634 | $this->propertyAccessor |
|
635 | ->expects($this->once()) |
|
636 | ->method('getValue') |
|
637 | ->with($this->identicalTo($object), $this->identicalTo($parameter)) |
|
638 | ->will($this->returnValue($value)); |
|
639 | ||
640 | $this->assertSame([$parameter => $value], $this->parameterResolver->resolveRedirectRouteParameters($object)); |
|
641 | } |
|
642 | ||
643 | public function testResolveRedirectRouteParametersForwardParameters() |
|
644 | { |