From de444857dd8acead93231ef96df170d08e8c4cc5 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 15 Oct 2015 10:23:00 -0400 Subject: [PATCH] Add partial test for config delete --- src/Aviat/AnimeClient/Config.php | 4 ++-- tests/AnimeClient/ConfigTest.php | 7 ++++--- tests/AnimeClient/Model/BaseApiModelTest.php | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Aviat/AnimeClient/Config.php b/src/Aviat/AnimeClient/Config.php index d3f40c63..4a238aed 100644 --- a/src/Aviat/AnimeClient/Config.php +++ b/src/Aviat/AnimeClient/Config.php @@ -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; } /** diff --git a/tests/AnimeClient/ConfigTest.php b/tests/AnimeClient/ConfigTest.php index 0f338353..5258a782 100644 --- a/tests/AnimeClient/ConfigTest.php +++ b/tests/AnimeClient/ConfigTest.php @@ -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); diff --git a/tests/AnimeClient/Model/BaseApiModelTest.php b/tests/AnimeClient/Model/BaseApiModelTest.php index b8d19527..ac0639d0 100644 --- a/tests/AnimeClient/Model/BaseApiModelTest.php +++ b/tests/AnimeClient/Model/BaseApiModelTest.php @@ -58,7 +58,7 @@ class BaseApiModelTest extends AnimeClient_TestCase { ]; return [ - 'invalid' => [ + 'invalid method' => [ 'method' => 'foo', 'uri' => '', 'options' => [],