| @@ 446-460 (lines=15) @@ | ||
| 443 | /** |
|
| 444 | * Test that instance of Iterator is traversable |
|
| 445 | */ |
|
| 446 | public function testIsTraversableIterator(){ |
|
| 447 | $iterator = new class implements \Iterator { |
|
| 448 | public function current(){} |
|
| 449 | public function next(){} |
|
| 450 | public function key(){} |
|
| 451 | public function valid(){} |
|
| 452 | public function rewind(){} |
|
| 453 | }; |
|
| 454 | $reflector = new \ReflectionClass('\Ds\Cache\Cache'); |
|
| 455 | $method = $reflector->getMethod('_isTraversable'); |
|
| 456 | $method->setAccessible(true); |
|
| 457 | $actual = $method->invokeArgs($this->cache, [$iterator]); |
|
| 458 | $expected = true; |
|
| 459 | $this->assertEquals($expected, $actual); |
|
| 460 | } |
|
| 461 | } |
|
| 462 | ||
| @@ 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 | ||