| @@ 48-62 (lines=15) @@ | ||
| 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 |
|
| @@ 175-189 (lines=15) @@ | ||
| 172 | /** |
|
| 173 | * Test that CacheStorageInterface::get() doesn't return values and default is returned. |
|
| 174 | */ |
|
| 175 | public function testGetDefaultValue() |
|
| 176 | { |
|
| 177 | $key = 'key'; |
|
| 178 | $default = 'default value'; |
|
| 179 | ||
| 180 | $this->storageMock->expects($this->once()) |
|
| 181 | ->method('has') |
|
| 182 | ->with( |
|
| 183 | $this->equalTo($key) |
|
| 184 | ) |
|
| 185 | ->willReturn(false); |
|
| 186 | ||
| 187 | $actual = $this->cache->get($key, $default); |
|
| 188 | $this->assertEquals($default, $actual); |
|
| 189 | } |
|
| 190 | ||
| 191 | /** |
|
| 192 | * Test that CacheStorageInterface::delete() is called |
|