Code Duplication    Length = 23-24 lines in 2 locations

eZ/Publish/Core/Persistence/Cache/Tests/LocationHandlerTest.php 1 location

@@ 780-802 (lines=23) @@
777
    /**
778
     * @covers eZ\Publish\Core\Persistence\Cache\LocationHandler::setSectionForSubtree
779
     */
780
    public function testSetSectionForSubtree()
781
    {
782
        $this->loggerMock->expects($this->once())->method('logCall');
783
        $this->cacheMock
784
            ->expects($this->once())
785
            ->method('clear')
786
            ->with('content');
787
788
        $innerHandler = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\Location\\Handler');
789
        $this->persistenceHandlerMock
790
            ->expects($this->once())
791
            ->method('locationHandler')
792
            ->will($this->returnValue($innerHandler));
793
794
        $innerHandler
795
            ->expects($this->once())
796
            ->method('setSectionForSubtree')
797
            ->with(33, 2)
798
            ->will($this->returnValue(null));
799
800
        $handler = $this->persistenceCacheHandler->locationHandler();
801
        $handler->setSectionForSubtree(33, 2);
802
    }
803
804
    /**
805
     * @covers eZ\Publish\Core\Persistence\Cache\LocationHandler::changeMainLocation

eZ/Publish/Core/Persistence/Cache/Tests/UrlAliasHandlerTest.php 1 location

@@ 788-811 (lines=24) @@
785
    /**
786
     * @covers eZ\Publish\Core\Persistence\Cache\UrlAliasHandler::locationMoved
787
     */
788
    public function testLocationMoved()
789
    {
790
        $this->loggerMock->expects($this->once())->method('logCall');
791
792
        $innerHandler = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\UrlAlias\\Handler');
793
        $this->persistenceHandlerMock
794
            ->expects($this->once())
795
            ->method('urlAliasHandler')
796
            ->will($this->returnValue($innerHandler));
797
798
        $innerHandler
799
            ->expects($this->once())
800
            ->method('locationMoved')
801
            ->with(44, 2, 45);
802
803
        $this->cacheMock
804
            ->expects($this->once())
805
            ->method('clear')
806
            ->with('urlAlias')
807
            ->will($this->returnValue(null));
808
809
        $handler = $this->persistenceCacheHandler->urlAliasHandler();
810
        $handler->locationMoved(44, 2, 45);
811
    }
812
813
    /**
814
     * @covers eZ\Publish\Core\Persistence\Cache\UrlAliasHandler::locationDeleted