|
@@ 370-379 (lines=10) @@
|
| 367 |
|
/** |
| 368 |
|
* Test that array has keys. |
| 369 |
|
*/ |
| 370 |
|
public function testArrayHasKeys(){ |
| 371 |
|
$data = ['a' => 'foo', 'b' => 'bar']; |
| 372 |
|
|
| 373 |
|
$reflector = new \ReflectionClass('\Ds\Cache\Cache'); |
| 374 |
|
$method = $reflector->getMethod('_hasKeys'); |
| 375 |
|
$method->setAccessible(true); |
| 376 |
|
$actual = $method->invokeArgs($this->cache, [$data]); |
| 377 |
|
|
| 378 |
|
$this->assertEquals(true, $actual); |
| 379 |
|
} |
| 380 |
|
|
| 381 |
|
/** |
| 382 |
|
* Test exception thrown when array is missing keys. |
|
@@ 422-430 (lines=9) @@
|
| 419 |
|
/** |
| 420 |
|
* Test that array is Traversable |
| 421 |
|
*/ |
| 422 |
|
public function testIsTraversable(){ |
| 423 |
|
$data = ['a','b','c','d']; |
| 424 |
|
$reflector = new \ReflectionClass('\Ds\Cache\Cache'); |
| 425 |
|
$method = $reflector->getMethod('_isTraversable'); |
| 426 |
|
$method->setAccessible(true); |
| 427 |
|
$actual = $method->invokeArgs($this->cache, [$data]); |
| 428 |
|
$expected = true; |
| 429 |
|
$this->assertEquals($expected, $actual); |
| 430 |
|
} |
| 431 |
|
|
| 432 |
|
/** |
| 433 |
|
* Test that string is not Traversable |