diff options
| author | Stephan Borg <wolff_borg@users.sourceforge.net> | 2005-09-11 07:41:26 +0000 |
|---|---|---|
| committer | Stephan Borg <wolff_borg@users.sourceforge.net> | 2005-09-11 07:41:26 +0000 |
| commit | 7745884492013114c0d90214ad714c7078a1eb5a (patch) | |
| tree | 2af1b0cedf58795ba3a197d154982fa0fa33eff9 /test/TestBitPreferencesCacheDatabase.php | |
| parent | a3fcd739cba7ff89e52f687c984c300dd1eb67df (diff) | |
| download | kernel-7745884492013114c0d90214ad714c7078a1eb5a.tar.gz kernel-7745884492013114c0d90214ad714c7078a1eb5a.tar.bz2 kernel-7745884492013114c0d90214ad714c7078a1eb5a.zip | |
Fixed tests
Diffstat (limited to 'test/TestBitPreferencesCacheDatabase.php')
| -rw-r--r-- | test/TestBitPreferencesCacheDatabase.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/test/TestBitPreferencesCacheDatabase.php b/test/TestBitPreferencesCacheDatabase.php index be7fe04..a197cf1 100644 --- a/test/TestBitPreferencesCacheDatabase.php +++ b/test/TestBitPreferencesCacheDatabase.php @@ -6,6 +6,12 @@ class TestBitPreferencesCacheDatabase extends Test { var $name = "TestBitPreferencesCacheDatabase"; + function initBitPreferences() + { + $test = new BitPreferences($this->name, new BitCache(), new BitDb()); + return $test; + } + function TestBitPreferencesCacheDatabase() { global $gBitDb, $gBitCache; @@ -23,27 +29,27 @@ class TestBitPreferencesCacheDatabase extends Test { "); $gBitDb->createTables($tables); } - $test = new BitPreferences($this->name); + $test = $this->initBitPreferences(); Assert::equalsTrue($test != NULL, 'Error during initialisation'); } function testGetNonexistentItem() { - $test = new BitPreferences($this->name); + $test = $this->initBitPreferences(); Assert::equals($test->getPreference("test"), NULL); } function testSetNonexistentItem() { - $test = new BitPreferences($this->name); + $test = $this->initBitPreferences(); $test->setPreference("test", "123"); Assert::equals($test->getPreference("test"), "123"); } function testSetDefaultItem() { - $test = new BitPreferences($this->name); + $test = $this->initBitPreferences(); //$test->mDebug = true; $test->setDefaultPreference("test", "456"); Assert::equals($test->getPreference("test"), "123"); @@ -51,7 +57,7 @@ class TestBitPreferencesCacheDatabase extends Test { function testSetAsDefaultItem() { - $test = new BitPreferences($this->name); + $test = $this->initBitPreferences(); //$test->mDebug = true; $test->setDefaultPreference("test", "456"); $test->setPreference("test", "456"); @@ -60,7 +66,7 @@ class TestBitPreferencesCacheDatabase extends Test { function testResetItem() { - $test = new BitPreferences($this->name); + $test = $this->initBitPreferences(); $test->setDefaultPreference("test", "456"); $test->setPreference("test", NULL); Assert::equals($test->getPreference("test"), "456"); |
