Code Duplication    Length = 23-24 lines in 3 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 2 locations

@@ 767-790 (lines=24) @@
764
    /**
765
     * @covers eZ\Publish\Core\Persistence\Cache\UrlAliasHandler::locationMoved
766
     */
767
    public function testLocationMoved()
768
    {
769
        $this->loggerMock->expects($this->once())->method('logCall');
770
771
        $innerHandler = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\UrlAlias\\Handler');
772
        $this->persistenceHandlerMock
773
            ->expects($this->once())
774
            ->method('urlAliasHandler')
775
            ->will($this->returnValue($innerHandler));
776
777
        $innerHandler
778
            ->expects($this->once())
779
            ->method('locationMoved')
780
            ->with(44, 2, 45);
781
782
        $this->cacheMock
783
            ->expects($this->once())
784
            ->method('clear')
785
            ->with('urlAlias')
786
            ->will($this->returnValue(null));
787
788
        $handler = $this->persistenceCacheHandler->urlAliasHandler();
789
        $handler->locationMoved(44, 2, 45);
790
    }
791
792
    /**
793
     * @covers eZ\Publish\Core\Persistence\Cache\UrlAliasHandler::locationDeleted
@@ 795-818 (lines=24) @@
792
    /**
793
     * @covers eZ\Publish\Core\Persistence\Cache\UrlAliasHandler::locationDeleted
794
     */
795
    public function testLocationDeleted()
796
    {
797
        $this->loggerMock->expects($this->once())->method('logCall');
798
799
        $innerHandler = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\UrlAlias\\Handler');
800
        $this->persistenceHandlerMock
801
            ->expects($this->once())
802
            ->method('urlAliasHandler')
803
            ->will($this->returnValue($innerHandler));
804
805
        $innerHandler
806
            ->expects($this->once())
807
            ->method('locationDeleted')
808
            ->with(44);
809
810
        $this->cacheMock
811
            ->expects($this->once())
812
            ->method('clear')
813
            ->with('urlAlias', 'location', 44)
814
            ->will($this->returnValue(null));
815
816
        $handler = $this->persistenceCacheHandler->urlAliasHandler();
817
        $handler->locationDeleted(44);
818
    }
819
}
820