summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Borg <wolff_borg@users.sourceforge.net>2005-09-11 07:41:26 +0000
committerStephan Borg <wolff_borg@users.sourceforge.net>2005-09-11 07:41:26 +0000
commit7745884492013114c0d90214ad714c7078a1eb5a (patch)
tree2af1b0cedf58795ba3a197d154982fa0fa33eff9
parenta3fcd739cba7ff89e52f687c984c300dd1eb67df (diff)
downloadkernel-7745884492013114c0d90214ad714c7078a1eb5a.tar.gz
kernel-7745884492013114c0d90214ad714c7078a1eb5a.tar.bz2
kernel-7745884492013114c0d90214ad714c7078a1eb5a.zip
Fixed tests
-rw-r--r--test/TestBitCache.php3
-rw-r--r--test/TestBitPreferences.php9
-rw-r--r--test/TestBitPreferencesCache.php17
-rw-r--r--test/TestBitPreferencesCacheDatabase.php18
-rw-r--r--test/TestBitPreferencesDatabase.php6
-rw-r--r--test/TestBitSmartyFilter.php (renamed from test/TestBitSmartyFiler.php)3
6 files changed, 20 insertions, 36 deletions
diff --git a/test/TestBitCache.php b/test/TestBitCache.php
index 68814f2..a20ce1e 100644
--- a/test/TestBitCache.php
+++ b/test/TestBitCache.php
@@ -8,8 +8,7 @@ class TestBitCache extends Test {
function TestBitCache()
{
- // global $gBitCache;
- $this->test = new BitCache();
+ $this->test = new BitCache();
Assert::equals(is_object($this->test), 'Error during initialisation');
if (!is_object($this->test)) {
$this = NULL;
diff --git a/test/TestBitPreferences.php b/test/TestBitPreferences.php
index 8901136..e95d7e4 100644
--- a/test/TestBitPreferences.php
+++ b/test/TestBitPreferences.php
@@ -8,14 +8,7 @@ class TestBitPreferences extends Test {
function TestBitPreferences()
{
- global $gBitDb, $gCache;
- $tmpDB = $gBitDb;
- $tmpCache = $gCache;
- $gBitDb = NULL;
- $gCache = NULL;
- $this->test = new BitPreferences("TestBitPreferences");
- $gBitDb = $tmpDB;
- $gCache = $tmpCache;
+ $this->test = new BitPreferences("TestBitPreferences", NULL, NULL);
Assert::equalsTrue($this->test != NULL, 'Error during initialisation');
}
diff --git a/test/TestBitPreferencesCache.php b/test/TestBitPreferencesCache.php
index 8319559..eaa62f6 100644
--- a/test/TestBitPreferencesCache.php
+++ b/test/TestBitPreferencesCache.php
@@ -8,23 +8,14 @@ class TestBitPreferencesCache extends Test {
function initBitPreferences()
{
- global $gBitDb;
- $tmpDB = $gBitDb;
- $gBitDb = NULL;
- $test = new BitPreferences($this->name);
- $gBitDb = $tmpDB;
+ $test = new BitPreferences($this->name, new BitCache(), NULL);
return $test;
}
function TestBitPreferencesCache()
{
- global $gCache;
- if (!is_object($gCache)) {
- $this = NULL;
- return;
- }
$test = $this->initBitPreferences();
- Assert::equals($test != NULL, 'Error during initialisation');
+ Assert::equalsTrue($test != NULL, 'Error during initialisation');
}
@@ -40,14 +31,14 @@ class TestBitPreferencesCache extends Test {
$test->setPreference("test", "123");
Assert::equals($test->getPreference("test"), "123");
}
-
+
function testSetDefaultItem()
{
$test = $this->initBitPreferences();
$test->setDefaultPreference("test", "456");
Assert::equals($test->getPreference("test"), "123");
}
-
+
function testSetAsDefaultItem()
{
$test = $this->initBitPreferences();
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");
diff --git a/test/TestBitPreferencesDatabase.php b/test/TestBitPreferencesDatabase.php
index 27b3209..88dca1e 100644
--- a/test/TestBitPreferencesDatabase.php
+++ b/test/TestBitPreferencesDatabase.php
@@ -8,11 +8,7 @@ class TestBitPreferencesDatabase extends Test {
function initBitPreferences()
{
- global $gCache;
- $tmpCache = $gCache;
- $gCache = NULL;
- $test = new BitPreferences($this->name);
- $gCache = $tmpCache;
+ $test = new BitPreferences($this->name, NULL, new BitDb());
return $test;
}
diff --git a/test/TestBitSmartyFiler.php b/test/TestBitSmartyFilter.php
index 8a0c73b..0bd5ef4 100644
--- a/test/TestBitSmartyFiler.php
+++ b/test/TestBitSmartyFilter.php
@@ -8,7 +8,6 @@ class InputOutputTester {
}
-
class TestBitSmartyFilter extends Test {
var $filterTestDir;
@@ -19,7 +18,7 @@ class TestBitSmartyFilter extends Test {
{
// directory that contains test directories
$this->filterTestDir = 'smarty_filter_tests';
- $this->smartyDir = KERNEL_PKG_PATH . 'smarty_tiki';
+ $this->smartyDir = KERNEL_PKG_PATH . 'smarty_bit';
}
function testPrePostFilters ()