Code Duplication    Length = 36-36 lines in 2 locations

eZ/Publish/Core/Persistence/Cache/Tests/LocationHandlerTest.php 2 locations

@@ 484-519 (lines=36) @@
481
    /**
482
     * @covers \eZ\Publish\Core\Persistence\Cache\LocationHandler::move
483
     */
484
    public function testMove()
485
    {
486
        $this->loggerMock->expects($this->once())->method('logCall');
487
        $this->cacheMock
488
            ->expects($this->at(0))
489
            ->method('clear')
490
            ->with('location')
491
            ->will($this->returnValue(true));
492
493
        $this->cacheMock
494
            ->expects($this->at(1))
495
            ->method('clear')
496
            ->with('user', 'role', 'assignments', 'byGroup')
497
            ->will($this->returnValue(true));
498
499
        $this->cacheMock
500
            ->expects($this->at(2))
501
            ->method('clear')
502
            ->with('content')
503
            ->will($this->returnValue(true));
504
505
        $innerHandlerMock = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\Location\\Handler');
506
        $this->persistenceHandlerMock
507
            ->expects($this->once())
508
            ->method('locationHandler')
509
            ->will($this->returnValue($innerHandlerMock));
510
511
        $innerHandlerMock
512
            ->expects($this->once())
513
            ->method('move')
514
            ->with(33, 66)
515
            ->will($this->returnValue(true));
516
517
        $handler = $this->persistenceCacheHandler->locationHandler();
518
        $handler->move(33, 66);
519
    }
520
521
    /**
522
     * @covers \eZ\Publish\Core\Persistence\Cache\LocationHandler::markSubtreeModified
@@ 823-858 (lines=36) @@
820
    /**
821
     * @covers \eZ\Publish\Core\Persistence\Cache\LocationHandler::removeSubtree
822
     */
823
    public function testRemoveSubtree()
824
    {
825
        $this->loggerMock->expects($this->once())->method('logCall');
826
        $this->cacheMock
827
            ->expects($this->at(0))
828
            ->method('clear')
829
            ->with('location')
830
            ->will($this->returnValue(true));
831
832
        $this->cacheMock
833
            ->expects($this->at(1))
834
            ->method('clear')
835
            ->with('content')
836
            ->will($this->returnValue(true));
837
838
        $this->cacheMock
839
            ->expects($this->at(2))
840
            ->method('clear')
841
            ->with('user', 'role', 'assignments', 'byGroup')
842
            ->will($this->returnValue(true));
843
844
        $innerHandlerMock = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\Location\\Handler');
845
        $this->persistenceHandlerMock
846
            ->expects($this->once())
847
            ->method('locationHandler')
848
            ->will($this->returnValue($innerHandlerMock));
849
850
        $innerHandlerMock
851
            ->expects($this->once())
852
            ->method('removeSubtree')
853
            ->with(33)
854
            ->will($this->returnValue(true));
855
856
        $handler = $this->persistenceCacheHandler->locationHandler();
857
        $handler->removeSubtree(33);
858
    }
859
860
    /**
861
     * @covers \eZ\Publish\Core\Persistence\Cache\LocationHandler::setSectionForSubtree