@@ 384-391 (lines=8) @@ | ||
381 | /** |
|
382 | * Test exception thrown when array is missing keys. |
|
383 | */ |
|
384 | public function testArrayHasNoKeys(){ |
|
385 | $this->expectException(InvalidArgumentException::class); |
|
386 | $data = ['foo','bar']; |
|
387 | $reflector = new \ReflectionClass(Cache::class); |
|
388 | $method = $reflector->getMethod('_hasKeys'); |
|
389 | $method->setAccessible(true); |
|
390 | $method->invokeArgs($this->cache, [$data]); |
|
391 | } |
|
392 | ||
393 | /** |
|
394 | * Test array contains a failure. |
|
@@ 435-442 (lines=8) @@ | ||
432 | /** |
|
433 | * Test that string is not Traversable |
|
434 | */ |
|
435 | public function testIsNotTraversable(){ |
|
436 | $this->expectException(InvalidArgumentException::class); |
|
437 | $data = 'some-random-string'; |
|
438 | $reflector = new \ReflectionClass('\Ds\Cache\Cache'); |
|
439 | $method = $reflector->getMethod('_isTraversable'); |
|
440 | $method->setAccessible(true); |
|
441 | $method->invokeArgs($this->cache, [$data]); |
|
442 | } |
|
443 | ||
444 | /** |
|
445 | * Test that instance of Iterator is traversable |