Trying to get tests to pass

- Cast type array to array
- Try explicitly disconnecting db after test
This commit is contained in:
nathangray 2018-09-05 09:53:57 -06:00
parent 91b5782e5f
commit cf1f99a828
2 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -95,6 +95,10 @@ abstract class LoggedInTest extends TestCase
{
$GLOBALS['egw']->applications = null;
}
if($GLOBALS['egw']->db)
{
$GLOBALS['egw']->db->disconnect();
}
unset($GLOBALS['egw']);
}