Code Duplication    Length = 17-23 lines in 2 locations

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

@@ 75-97 (lines=23) @@
72
    /**
73
     * @covers \eZ\Publish\Core\Persistence\Cache\TransactionHandler::rollback
74
     */
75
    public function testRollback()
76
    {
77
        $this->loggerMock
78
            ->expects($this->once())
79
            ->method('logCall');
80
81
        $this->cacheMock
82
            ->expects($this->once())
83
            ->method('clear');
84
85
        $innerHandlerMock = $this->createMock(TransactionHandler::class);
86
        $this->persistenceHandlerMock
87
            ->expects($this->once())
88
            ->method('transactionHandler')
89
            ->will($this->returnValue($innerHandlerMock));
90
91
        $innerHandlerMock
92
            ->expects($this->once())
93
            ->method('rollback');
94
95
        $handler = $this->persistenceCacheHandler->transactionHandler();
96
        $handler->rollback();
97
    }
98
}
99

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

@@ 1110-1126 (lines=17) @@
1107
    /**
1108
     * @param $locationCacheMissed
1109
     */
1110
    protected function prepareDeleteMocks($locationCacheMissed)
1111
    {
1112
        $this->loggerMock->expects($this->once())->method('logCall');
1113
1114
        $innerHandler = $this->getSPIUrlAliasHandlerMock();
1115
        $this->persistenceHandlerMock
1116
            ->expects($this->once())
1117
            ->method('urlAliasHandler')
1118
            ->will($this->returnValue($innerHandler));
1119
1120
        $innerHandler->expects($this->once())->method('locationDeleted')->with(44);
1121
1122
        $this->cacheMock
1123
            ->expects($this->once())
1124
            ->method('getItem')
1125
            ->willReturn($locationCacheMissed);
1126
    }
1127
}
1128