From cf1f99a828d12b84a5d3b6ed671bb79e03630ae1 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 5 Sep 2018 09:53:57 -0600 Subject: [PATCH] Trying to get tests to pass - Cast type array to array - Try explicitly disconnecting db after test --- admin/tests/PreferencesCommandTest.php | 8 ++++---- api/tests/LoggedInTest.php | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/admin/tests/PreferencesCommandTest.php b/admin/tests/PreferencesCommandTest.php index 7765eb302f..8da7ed9b7e 100644 --- a/admin/tests/PreferencesCommandTest.php +++ b/admin/tests/PreferencesCommandTest.php @@ -72,7 +72,7 @@ class PreferencesCommandTest extends CommandBase $this->assertArrayHasKey($this->preference_name, $post[static::APP]); $this->assertEquals($set[$this->preference_name], $post[static::APP][$this->preference_name]); // At type level - $this->assertArrayHasKey($this->preference_name, $post_pref->$type[static::APP]); + $this->assertArrayHasKey($this->preference_name, (Array)$post_pref->$type[static::APP]); $this->assertEquals($set[$this->preference_name], $post_pref->$type[static::APP][$this->preference_name]); $this->assertGreaterThan($log_count, $this->get_log_count(), "Command ($command) did not log"); @@ -119,7 +119,7 @@ class PreferencesCommandTest extends CommandBase $this->assertEquals($set[$this->preference_name], $post[static::APP][$this->preference_name]); // At type level - $this->assertArrayHasKey($this->preference_name, $post_pref->$type[static::APP]); + $this->assertArrayHasKey($this->preference_name, (Array)$post_pref->$type[static::APP]); $this->assertEquals($set[$this->preference_name], $post_pref->$type[static::APP][$this->preference_name]); $this->assertGreaterThan($log_count, $this->get_log_count(), "Command ($command) did not log"); @@ -168,7 +168,7 @@ class PreferencesCommandTest extends CommandBase ); // At type level - $this->assertArrayHasKey($this->preference_name, $post_pref->$type[static::APP]); + $this->assertArrayHasKey($this->preference_name, (Array)$post_pref->$type[static::APP]); $this->assertEquals($set[$this->preference_name], $post_pref->$type[static::APP][$this->preference_name]); $this->assertGreaterThan($log_count, $this->get_log_count(), "Command ($command) did not log"); @@ -213,7 +213,7 @@ class PreferencesCommandTest extends CommandBase $post = $post_pref->read_repository(false); // At type level - should always be what we set - $this->assertArrayHasKey($this->preference_name, $post_pref->$type[static::APP]); + $this->assertArrayHasKey($this->preference_name, (Array)$post_pref->$type[static::APP]); $this->assertEquals($set[$this->preference_name], $post_pref->$type[static::APP][$this->preference_name]); // At user level - depends on type priority diff --git a/api/tests/LoggedInTest.php b/api/tests/LoggedInTest.php index da4e166760..d9b3793c73 100644 --- a/api/tests/LoggedInTest.php +++ b/api/tests/LoggedInTest.php @@ -95,6 +95,10 @@ abstract class LoggedInTest extends TestCase { $GLOBALS['egw']->applications = null; } + if($GLOBALS['egw']->db) + { + $GLOBALS['egw']->db->disconnect(); + } unset($GLOBALS['egw']); }