@@ 343-350 (lines=8) @@ | ||
340 | /** |
|
341 | * Test exception thrown when array is missing keys. |
|
342 | */ |
|
343 | public function testArrayHasNoKeys(){ |
|
344 | $this->expectException(InvalidArgumentException::class); |
|
345 | $data = ['foo','bar']; |
|
346 | $reflector = new \ReflectionClass(Cache::class); |
|
347 | $method = $reflector->getMethod('_hasKeys'); |
|
348 | $method->setAccessible(true); |
|
349 | $method->invokeArgs($this->cache, [$data]); |
|
350 | } |
|
351 | ||
352 | /** |
|
353 | * Test array contains a failure. |
|
@@ 394-401 (lines=8) @@ | ||
391 | /** |
|
392 | * Test that string is not Traversable |
|
393 | */ |
|
394 | public function testIsNotTraversable(){ |
|
395 | $this->expectException(InvalidArgumentException::class); |
|
396 | $data = 'some-random-string'; |
|
397 | $reflector = new \ReflectionClass(Cache::class); |
|
398 | $method = $reflector->getMethod('_isTraversable'); |
|
399 | $method->setAccessible(true); |
|
400 | $method->invokeArgs($this->cache, [$data]); |
|
401 | } |
|
402 | ||
403 | /** |
|
404 | * Test that instance of Iterator is traversable |