Code Duplication    Length = 36-36 lines in 2 locations

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

@@ 498-533 (lines=36) @@
495
    /**
496
     * @covers \eZ\Publish\Core\Persistence\Cache\LocationHandler::move
497
     */
498
    public function testMove()
499
    {
500
        $this->loggerMock->expects($this->once())->method('logCall');
501
        $this->cacheMock
502
            ->expects($this->at(0))
503
            ->method('clear')
504
            ->with('location')
505
            ->will($this->returnValue(true));
506
507
        $this->cacheMock
508
            ->expects($this->at(1))
509
            ->method('clear')
510
            ->with('user', 'role', 'assignments', 'byGroup')
511
            ->will($this->returnValue(true));
512
513
        $this->cacheMock
514
            ->expects($this->at(2))
515
            ->method('clear')
516
            ->with('content')
517
            ->will($this->returnValue(true));
518
519
        $innerHandlerMock = $this->getSPILocationHandlerMock();
520
        $this->persistenceHandlerMock
521
            ->expects($this->once())
522
            ->method('locationHandler')
523
            ->will($this->returnValue($innerHandlerMock));
524
525
        $innerHandlerMock
526
            ->expects($this->once())
527
            ->method('move')
528
            ->with(33, 66)
529
            ->will($this->returnValue(true));
530
531
        $handler = $this->persistenceCacheHandler->locationHandler();
532
        $handler->move(33, 66);
533
    }
534
535
    /**
536
     * @covers \eZ\Publish\Core\Persistence\Cache\LocationHandler::markSubtreeModified
@@ 837-872 (lines=36) @@
834
    /**
835
     * @covers \eZ\Publish\Core\Persistence\Cache\LocationHandler::removeSubtree
836
     */
837
    public function testRemoveSubtree()
838
    {
839
        $this->loggerMock->expects($this->once())->method('logCall');
840
        $this->cacheMock
841
            ->expects($this->at(0))
842
            ->method('clear')
843
            ->with('location')
844
            ->will($this->returnValue(true));
845
846
        $this->cacheMock
847
            ->expects($this->at(1))
848
            ->method('clear')
849
            ->with('content')
850
            ->will($this->returnValue(true));
851
852
        $this->cacheMock
853
            ->expects($this->at(2))
854
            ->method('clear')
855
            ->with('user', 'role', 'assignments', 'byGroup')
856
            ->will($this->returnValue(true));
857
858
        $innerHandlerMock = $this->getSPILocationHandlerMock();
859
        $this->persistenceHandlerMock
860
            ->expects($this->once())
861
            ->method('locationHandler')
862
            ->will($this->returnValue($innerHandlerMock));
863
864
        $innerHandlerMock
865
            ->expects($this->once())
866
            ->method('removeSubtree')
867
            ->with(33)
868
            ->will($this->returnValue(true));
869
870
        $handler = $this->persistenceCacheHandler->locationHandler();
871
        $handler->removeSubtree(33);
872
    }
873
874
    /**
875
     * @covers \eZ\Publish\Core\Persistence\Cache\LocationHandler::setSectionForSubtree