Code Duplication    Length = 24-24 lines in 2 locations

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

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