Code Duplication    Length = 15-17 lines in 4 locations

Tests/Cache/CacheTest.php 3 locations

@@ 48-64 (lines=17) @@
45
    /**
46
     * Test that CacheStorageInterface::set() is called
47
     */
48
    public function testSet()
49
    {
50
        $key = 'key';
51
        $value = 'value';
52
        $expires = 10;
53
54
        $this->storageMock->expects($this->once())
55
            ->method('set')
56
            ->with(
57
                $this->equalTo($key),
58
                $this->equalTo($value),
59
                $this->equalTo($expires)
60
            );
61
        $this->cache->set($key, $value, $expires);
62
    }
63
64
    /**
65
     * Test that CacheStorageInterface::set() is called
66
     */
67
    public function testSetDateInterval()
@@ 99-113 (lines=15) @@
96
    /**
97
     * Test that CacheStorageInterface::has() is called and returns true on finding key
98
     */
99
    public function testHasFoundWithKey()
100
    {
101
        $key = 'key';
102
        $expected = true;
103
104
        $this->storageMock->expects($this->once())
105
            ->method('has')
106
            ->with(
107
                $this->equalTo($key)
108
            )
109
            ->willReturn($expected);
110
111
        $actual = $this->cache->has($key);
112
        $this->assertEquals($expected, $actual);
113
    }
114
115
    /**
116
     * Test that CacheStorageInterface::has() is called and returns false on failing to find key
@@ 118-132 (lines=15) @@
115
    /**
116
     * Test that CacheStorageInterface::has() is called and returns false on failing to find key
117
     */
118
    public function testHasFoundNoKey()
119
    {
120
        $key = 'key';
121
        $expected = false;
122
123
        $this->storageMock->expects($this->once())
124
            ->method('has')
125
            ->with(
126
                $this->equalTo($key)
127
            )
128
            ->willReturn($expected);
129
130
        $actual = $this->cache->has($key);
131
        $this->assertEquals($expected, $actual);
132
    }
133
134
135
    /**

Tests/Cache/Storage/MemcacheStorageTest.php 1 location

@@ 90-105 (lines=16) @@
87
            [false]
88
        );
89
    }
90
    public function testSet()
91
    {
92
        $key = 'key';
93
        $value = 'value';
94
        $expires = 10;
95
        $this->memcacheMock->expects($this->once())
96
            ->method('set')
97
            ->with(
98
                $this->equalTo($key),
99
                $this->equalTo($value),
100
                $this->equalTo($expires)
101
            );
102
        $this->memcacheStorage->set($key, $value, $expires);
103
    }
104
    public function testGet()
105
    {
106
        $key = 'key';
107
        $this->memcacheMock->expects($this->once())
108
            ->method('get')