Code Duplication    Length = 24-24 lines in 2 locations

src/Bundle/ResourceBundle/Tests/Routing/ParameterResolverTest.php 2 locations

@@ 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
    {
@@ 638-661 (lines=24) @@
635
        $this->assertEmpty($this->parameterResolver->resolveRedirectRouteParameters(new \stdClass()));
636
    }
637
638
    public function testResolveRedirectRouteParametersExplicit()
639
    {
640
        $this->requestStack
641
            ->expects($this->once())
642
            ->method('getMasterRequest')
643
            ->will($this->returnValue($request = $this->createRequestMock()));
644
645
        $request->attributes
646
            ->expects($this->once())
647
            ->method('get')
648
            ->with($this->identicalTo('_lug_redirect_route_parameters'), $this->identicalTo([]))
649
            ->will($this->returnValue([$parameter = 'id']));
650
651
        $object = new \stdClass();
652
        $object->{$parameter} = $value = 1;
653
654
        $this->propertyAccessor
655
            ->expects($this->once())
656
            ->method('getValue')
657
            ->with($this->identicalTo($object), $this->identicalTo($parameter))
658
            ->will($this->returnValue($value));
659
660
        $this->assertSame([$parameter => $value], $this->parameterResolver->resolveRedirectRouteParameters($object));
661
    }
662
663
    public function testResolveRedirectRouteParametersForwardParameters()
664
    {