Code Duplication    Length = 13-13 lines in 4 locations

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

@@ 102-114 (lines=13) @@
99
        $this->loggerMock->expects($this->never())->method('logCall');
100
        $this->loggerMock->expects($this->never())->method('logCacheMiss');
101
102
        if ($multi) {
103
            $this->cacheMock
104
                ->expects($this->once())
105
                ->method('getItems')
106
                ->with([$cacheItem->getKey()])
107
                ->willReturn([$key => $cacheItem]);
108
        } else {
109
            $this->cacheMock
110
                ->expects($this->once())
111
                ->method('getItem')
112
                ->with($cacheItem->getKey())
113
                ->willReturn($cacheItem);
114
        }
115
116
        $this->persistenceHandlerMock
117
            ->expects($this->never())
@@ 151-163 (lines=13) @@
148
        $this->loggerMock->expects($this->never())->method('logCall');
149
        $this->loggerMock->expects($this->never())->method('logCacheHit');
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

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