Add partial test for config delete

This commit is contained in:
Timothy Warren 2015-10-15 10:23:00 -04:00
parent d231b39fdc
commit de444857dd
3 changed files with 7 additions and 6 deletions

View File

@ -39,7 +39,7 @@ class Config {
{
if (is_array($key))
{
return $this->get_deep_key($key, FALSE);
return $this->arr($this->map)->get_deep_key($key);
}
if (array_key_exists($key, $this->map))
@ -104,7 +104,7 @@ class Config {
$pos =& $this->map[$key];
}
unset($pos);
$pos = NULL;
}
/**

View File

@ -18,6 +18,8 @@ class ConfigTest extends AnimeClient_TestCase {
$this->assertEquals('bar', $this->config->get('foo'));
$this->assertEquals('baz', $this->config->get('bar'));
$this->assertNull($this->config->get('baz'));
$this->assertNull($this->config->get(['apple','sauce']));
}
public function testConfigSet()
@ -49,7 +51,7 @@ class ConfigTest extends AnimeClient_TestCase {
]
]
],
'mid level delete' => [
/*'mid level delete' => [
'key' => ['apple', 'sauce'],
'assertKeys' => [
[
@ -78,7 +80,7 @@ class ConfigTest extends AnimeClient_TestCase {
'expected' => NULL
]
]
]
]*/
];
}
@ -87,7 +89,6 @@ class ConfigTest extends AnimeClient_TestCase {
*/
public function testConfigDelete($key, $assertKeys)
{
$this->markTestIncomplete();
$this->config->set(['apple', 'sauce', 'is'], 'great');
$this->config->delete($key);

View File

@ -58,7 +58,7 @@ class BaseApiModelTest extends AnimeClient_TestCase {
];
return [
'invalid' => [
'invalid method' => [
'method' => 'foo',
'uri' => '',
'options' => [],