Code Duplication    Length = 13-13 lines in 4 locations

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

@@ 96-108 (lines=13) @@
93
        $this->loggerMock->expects($this->never())->method('logCall');
94
        $this->loggerMock->expects($this->never())->method('logCacheMiss');
95
96
        if ($multi) {
97
            $this->cacheMock
98
                ->expects($this->once())
99
                ->method('getItems')
100
                ->with([$cacheItem->getKey()])
101
                ->willReturn([$key => $cacheItem]);
102
        } else {
103
            $this->cacheMock
104
                ->expects($this->once())
105
                ->method('getItem')
106
                ->with($cacheItem->getKey())
107
                ->willReturn($cacheItem);
108
        }
109
110
        $this->persistenceHandlerMock
111
            ->expects($this->never())
@@ 145-157 (lines=13) @@
142
        $this->loggerMock->expects($this->never())->method('logCall');
143
        $this->loggerMock->expects($this->never())->method('logCacheHit');
144
145
        if ($multi) {
146
            $this->cacheMock
147
                ->expects($this->once())
148
                ->method('getItems')
149
                ->with([$cacheItem->getKey()])
150
                ->willReturn([$key => $cacheItem]);
151
        } else {
152
            $this->cacheMock
153
                ->expects($this->once())
154
                ->method('getItem')
155
                ->with($cacheItem->getKey())
156
                ->willReturn($cacheItem);
157
        }
158
159
        $innerHandlerMock = $this->createMock($this->getHandlerClassName());
160
        $this->persistenceHandlerMock

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

@@ 95-107 (lines=13) @@
92
93
        $this->loggerMock->expects($this->never())->method('logCall');
94
95
        if ($multi) {
96
            $this->cacheMock
97
                ->expects($this->once())
98
                ->method('getItems')
99
                ->with([$cacheItem->getKey()])
100
                ->willReturn([$key => $cacheItem]);
101
        } else {
102
            $this->cacheMock
103
                ->expects($this->once())
104
                ->method('getItem')
105
                ->with($cacheItem->getKey())
106
                ->willReturn($cacheItem);
107
        }
108
109
        $this->persistenceHandlerMock
110
            ->expects($this->never())
@@ 142-154 (lines=13) @@
139
140
        $this->loggerMock->expects($this->once())->method('logCall');
141
142
        if ($multi) {
143
            $this->cacheMock
144
                ->expects($this->once())
145
                ->method('getItems')
146
                ->with([$cacheItem->getKey()])
147
                ->willReturn([$key => $cacheItem]);
148
        } else {
149
            $this->cacheMock
150
                ->expects($this->once())
151
                ->method('getItem')
152
                ->with($cacheItem->getKey())
153
                ->willReturn($cacheItem);
154
        }
155
156
        $innerHandlerMock = $this->createMock($this->getHandlerClassName());
157
        $this->persistenceHandlerMock