@@ 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') |
@@ 100-114 (lines=15) @@ | ||
97 | /** |
|
98 | * Test that CacheStorageInterface::has() is called and returns true on finding key |
|
99 | */ |
|
100 | public function testHasFoundWithKey() |
|
101 | { |
|
102 | $key = 'key'; |
|
103 | $expected = true; |
|
104 | ||
105 | $this->storageMock->expects($this->once()) |
|
106 | ->method('has') |
|
107 | ->with( |
|
108 | $this->equalTo($key) |
|
109 | ) |
|
110 | ->willReturn($expected); |
|
111 | ||
112 | $actual = $this->cache->has($key); |
|
113 | $this->assertEquals($expected, $actual); |
|
114 | } |
|
115 | ||
116 | /** |
|
117 | * Test that CacheStorageInterface::has() is called and returns false on failing to find key |
|
@@ 119-133 (lines=15) @@ | ||
116 | /** |
|
117 | * Test that CacheStorageInterface::has() is called and returns false on failing to find key |
|
118 | */ |
|
119 | public function testHasFoundNoKey() |
|
120 | { |
|
121 | $key = 'key'; |
|
122 | $expected = false; |
|
123 | ||
124 | $this->storageMock->expects($this->once()) |
|
125 | ->method('has') |
|
126 | ->with( |
|
127 | $this->equalTo($key) |
|
128 | ) |
|
129 | ->willReturn($expected); |
|
130 | ||
131 | $actual = $this->cache->has($key); |
|
132 | $this->assertEquals($expected, $actual); |
|
133 | } |
|
134 | ||
135 | ||
136 | /** |