示例#1
0
 public function testResolveLocationRouteParametersExplicit()
 {
     $this->requestStack->expects($this->once())->method('getMasterRequest')->will($this->returnValue($request = $this->createRequestMock()));
     $request->attributes->expects($this->once())->method('get')->with($this->identicalTo('_lug_location_route_parameters'), $this->identicalTo([]))->will($this->returnValue([$parameter = 'id']));
     $object = new \stdClass();
     $object->{$parameter} = $value = 1;
     $this->propertyAccessor->expects($this->once())->method('getValue')->with($this->identicalTo($object), $this->identicalTo($parameter))->will($this->returnValue($value));
     $this->assertSame([$parameter => $value], $this->parameterResolver->resolveLocationRouteParameters($object));
 }