Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 51-65 (lines=15) @@
48
            ->with(...$arguments)
49
            ->will($this->returnValue($returnValue));
50
51
        if ($tags || $key) {
52
            $this->cacheMock
53
                ->expects(!empty($tags) ? $this->once() : $this->never())
54
                ->method('invalidateTags')
55
                ->with($tags);
56
57
            $this->cacheMock
58
                ->expects(!empty($key) ? $this->once() : $this->never())
59
                ->method('deleteItem')
60
                ->with($key);
61
        } else {
62
            $this->cacheMock
63
                ->expects($this->never())
64
                ->method($this->anything());
65
        }
66
67
        $handler = $this->persistenceCacheHandler->$handlerMethodName();
68
        call_user_func_array(array($handler, $method), $arguments);

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

@@ 53-67 (lines=15) @@
50
            ->with(...$arguments)
51
            ->will($this->returnValue($returnValue));
52
53
        if ($tags || $key) {
54
            $this->cacheMock
55
                ->expects(!empty($tags) ? $this->once() : $this->never())
56
                ->method('invalidateTags')
57
                ->with($tags);
58
59
            $this->cacheMock
60
                ->expects(!empty($key) ? $this->once() : $this->never())
61
                ->method('deleteItems')
62
                ->with($key);
63
        } else {
64
            $this->cacheMock
65
                ->expects($this->never())
66
                ->method($this->anything());
67
        }
68
69
        $handler = $this->persistenceCacheHandler->$handlerMethodName();
70
        call_user_func_array(array($handler, $method), $arguments);