Code Duplication    Length = 13-13 lines in 4 locations

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

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

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

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