Code Duplication    Length = 25-26 lines in 3 locations

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

@@ 302-326 (lines=25) @@
299
    /**
300
     * @covers \eZ\Publish\Core\Persistence\Cache\ContentHandler::setStatus
301
     */
302
    public function testSetStatus()
303
    {
304
        $this->loggerMock->expects($this->once())->method('logCall');
305
306
        $innerHandlerMock = $this->createMock(SPIContentHandler::class);
307
        $this->persistenceHandlerMock
308
            ->expects($this->once())
309
            ->method('contentHandler')
310
            ->will($this->returnValue($innerHandlerMock));
311
312
        $innerHandlerMock
313
            ->expects($this->once())
314
            ->method('setStatus')
315
            ->with(2, VersionInfo::STATUS_ARCHIVED, 1)
316
            ->will($this->returnValue(true));
317
318
        $this->cacheMock
319
            ->expects($this->once())
320
            ->method('clear')
321
            ->with('content', 2, 1)
322
            ->will($this->returnValue(null));
323
324
        $handler = $this->persistenceCacheHandler->contentHandler();
325
        $handler->setStatus(2, VersionInfo::STATUS_ARCHIVED, 1);
326
    }
327
328
    /**
329
     * @covers \eZ\Publish\Core\Persistence\Cache\ContentHandler::setStatus

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

@@ 960-985 (lines=26) @@
957
    /**
958
     * @covers \eZ\Publish\Core\Persistence\Cache\ContentTypeHandler::link
959
     */
960
    public function testLink()
961
    {
962
        $this->loggerMock->expects($this->once())->method('logCall');
963
        $this->cacheMock
964
            ->expects($this->at(0))
965
            ->method('clear')
966
            ->with('contentType', 44)
967
            ->will($this->returnValue(true));
968
969
        $innerHandlerMock = $this->getContentTypeHandlerMock();
970
        $this->persistenceHandlerMock
971
            ->expects($this->once())
972
            ->method('contentTypeHandler')
973
            ->will($this->returnValue($innerHandlerMock));
974
975
        $innerHandlerMock
976
            ->expects($this->once())
977
            ->method('link')
978
            ->with(22, 44, SPIType::STATUS_DEFINED)
979
            ->will(
980
                $this->returnValue(true)
981
            );
982
983
        $handler = $this->persistenceCacheHandler->contentTypeHandler();
984
        $handler->link(22, 44, SPIType::STATUS_DEFINED);
985
    }
986
987
    /**
988
     * @covers \eZ\Publish\Core\Persistence\Cache\ContentTypeHandler::link
@@ 1018-1043 (lines=26) @@
1015
    /**
1016
     * @covers \eZ\Publish\Core\Persistence\Cache\ContentTypeHandler::unlink
1017
     */
1018
    public function testUnlink()
1019
    {
1020
        $this->loggerMock->expects($this->once())->method('logCall');
1021
        $this->cacheMock
1022
            ->expects($this->at(0))
1023
            ->method('clear')
1024
            ->with('contentType', 44)
1025
            ->will($this->returnValue(true));
1026
1027
        $innerHandlerMock = $this->getContentTypeHandlerMock();
1028
        $this->persistenceHandlerMock
1029
            ->expects($this->once())
1030
            ->method('contentTypeHandler')
1031
            ->will($this->returnValue($innerHandlerMock));
1032
1033
        $innerHandlerMock
1034
            ->expects($this->once())
1035
            ->method('unlink')
1036
            ->with(22, 44, SPIType::STATUS_DEFINED)
1037
            ->will(
1038
                $this->returnValue(true)
1039
            );
1040
1041
        $handler = $this->persistenceCacheHandler->contentTypeHandler();
1042
        $handler->unlink(22, 44, SPIType::STATUS_DEFINED);
1043
    }
1044
1045
    /**
1046
     * @covers \eZ\Publish\Core\Persistence\Cache\ContentTypeHandler::unlink