| @@ 447-455 (lines=9) @@ | ||
| 444 | /** |
|
| 445 | * Test that instance of Iterator is traversable |
|
| 446 | */ |
|
| 447 | public function testIsTraversableIterator(){ |
|
| 448 | $iterator = new IteratorMock(); |
|
| 449 | $reflector = new \ReflectionClass('\Ds\Cache\Cache'); |
|
| 450 | $method = $reflector->getMethod('_isTraversable'); |
|
| 451 | $method->setAccessible(true); |
|
| 452 | $actual = $method->invokeArgs($this->cache, [$iterator]); |
|
| 453 | $expected = true; |
|
| 454 | $this->assertEquals($expected, $actual); |
|
| 455 | } |
|
| 456 | } |
|
| 457 | ||
| @@ 137-144 (lines=8) @@ | ||
| 134 | $method->invokeArgs($this->cacheStorage, [$key, $value, $ttl]); |
|
| 135 | } |
|
| 136 | ||
| 137 | public function testFetchCacheNoItem(){ |
|
| 138 | $reflector = new \ReflectionClass(FileStorage::class); |
|
| 139 | $method = $reflector->getMethod('_fetchCacheFile'); |
|
| 140 | $method->setAccessible(true); |
|
| 141 | $key= 'unknown'; |
|
| 142 | $actual = $method->invokeArgs($this->cacheStorage, [$key]); |
|
| 143 | $this->assertEquals(false, $actual); |
|
| 144 | } |
|
| 145 | ||
| 146 | public function testFetchCacheValid(){ |
|
| 147 | ||