Add partial test for config delete
This commit is contained in:
parent
5bf46e0840
commit
67080a098f
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
||||
|
@ -58,7 +58,7 @@ class BaseApiModelTest extends AnimeClient_TestCase {
|
||||
];
|
||||
|
||||
return [
|
||||
'invalid' => [
|
||||
'invalid method' => [
|
||||
'method' => 'foo',
|
||||
'uri' => '',
|
||||
'options' => [],
|
||||
|
Loading…
Reference in New Issue
Block a user