@@ 329-338 (lines=10) @@ | ||
326 | /** |
|
327 | * Test that array has keys. |
|
328 | */ |
|
329 | public function testArrayHasKeys(){ |
|
330 | $data = ['a' => 'foo', 'b' => 'bar']; |
|
331 | ||
332 | $reflector = new \ReflectionClass(Cache::class); |
|
333 | $method = $reflector->getMethod('_hasKeys'); |
|
334 | $method->setAccessible(true); |
|
335 | $actual = $method->invokeArgs($this->cache, [$data]); |
|
336 | ||
337 | $this->assertEquals(true, $actual); |
|
338 | } |
|
339 | ||
340 | /** |
|
341 | * Test exception thrown when array is missing keys. |
|
@@ 381-389 (lines=9) @@ | ||
378 | /** |
|
379 | * Test that array is Traversable |
|
380 | */ |
|
381 | public function testIsTraversable(){ |
|
382 | $data = ['a','b','c','d']; |
|
383 | $reflector = new \ReflectionClass(Cache::class); |
|
384 | $method = $reflector->getMethod('_isTraversable'); |
|
385 | $method->setAccessible(true); |
|
386 | $actual = $method->invokeArgs($this->cache, [$data]); |
|
387 | $expected = true; |
|
388 | $this->assertEquals($expected, $actual); |
|
389 | } |
|
390 | ||
391 | /** |
|
392 | * Test that string is not Traversable |