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))
|
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))
|
if (array_key_exists($key, $this->map))
|
||||||
@ -104,7 +104,7 @@ class Config {
|
|||||||
$pos =& $this->map[$key];
|
$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('bar', $this->config->get('foo'));
|
||||||
$this->assertEquals('baz', $this->config->get('bar'));
|
$this->assertEquals('baz', $this->config->get('bar'));
|
||||||
$this->assertNull($this->config->get('baz'));
|
$this->assertNull($this->config->get('baz'));
|
||||||
|
|
||||||
|
$this->assertNull($this->config->get(['apple','sauce']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testConfigSet()
|
public function testConfigSet()
|
||||||
@ -49,7 +51,7 @@ class ConfigTest extends AnimeClient_TestCase {
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'mid level delete' => [
|
/*'mid level delete' => [
|
||||||
'key' => ['apple', 'sauce'],
|
'key' => ['apple', 'sauce'],
|
||||||
'assertKeys' => [
|
'assertKeys' => [
|
||||||
[
|
[
|
||||||
@ -78,7 +80,7 @@ class ConfigTest extends AnimeClient_TestCase {
|
|||||||
'expected' => NULL
|
'expected' => NULL
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]*/
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +89,6 @@ class ConfigTest extends AnimeClient_TestCase {
|
|||||||
*/
|
*/
|
||||||
public function testConfigDelete($key, $assertKeys)
|
public function testConfigDelete($key, $assertKeys)
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete();
|
|
||||||
$this->config->set(['apple', 'sauce', 'is'], 'great');
|
$this->config->set(['apple', 'sauce', 'is'], 'great');
|
||||||
$this->config->delete($key);
|
$this->config->delete($key);
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class BaseApiModelTest extends AnimeClient_TestCase {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'invalid' => [
|
'invalid method' => [
|
||||||
'method' => 'foo',
|
'method' => 'foo',
|
||||||
'uri' => '',
|
'uri' => '',
|
||||||
'options' => [],
|
'options' => [],
|
||||||
|
Loading…
Reference in New Issue
Block a user