|
@@ 91-102 (lines=12) @@
|
| 88 |
|
/** |
| 89 |
|
* @throws \Psr\SimpleCache\InvalidArgumentException |
| 90 |
|
*/ |
| 91 |
|
public function testGetProxiesToDoctrineFetch() |
| 92 |
|
{ |
| 93 |
|
$key = uniqid('key', true); |
| 94 |
|
$value = uniqid('value', true); |
| 95 |
|
|
| 96 |
|
/** @var FullyImplementedCache|\PHPUnit_Framework_MockObject_MockObject $doctrineCache */ |
| 97 |
|
$doctrineCache = $this->createMock(FullyImplementedCache::class); |
| 98 |
|
$doctrineCache->expects(self::once())->method('fetch')->with($key)->willReturn($value); |
| 99 |
|
|
| 100 |
|
$psrCache = new SimpleCacheAdapter($doctrineCache); |
| 101 |
|
self::assertSame($value, $psrCache->get($key)); |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
/** |
| 105 |
|
* @throws \Psr\SimpleCache\InvalidArgumentException |
|
@@ 283-295 (lines=13) @@
|
| 280 |
|
* @param mixed $key |
| 281 |
|
* @dataProvider validKeys |
| 282 |
|
*/ |
| 283 |
|
public function testGetMultipleAcceptsTraversable($key) |
| 284 |
|
{ |
| 285 |
|
$values = [ |
| 286 |
|
$key => uniqid('value', true), |
| 287 |
|
]; |
| 288 |
|
|
| 289 |
|
/** @var FullyImplementedCache|\PHPUnit_Framework_MockObject_MockObject $doctrineCache */ |
| 290 |
|
$doctrineCache = $this->createMock(FullyImplementedCache::class); |
| 291 |
|
$doctrineCache->expects(self::once())->method('fetchMultiple')->with(array_keys($values))->willReturn($values); |
| 292 |
|
|
| 293 |
|
$psrCache = new SimpleCacheAdapter($doctrineCache); |
| 294 |
|
$psrCache->getMultiple(new \ArrayObject(array_keys($values))); |
| 295 |
|
} |
| 296 |
|
|
| 297 |
|
/** |
| 298 |
|
* @throws \Exception |