summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-05-19 07:38:35 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-05-19 07:38:35 +0200
commitef23f01ebab448f10cb3935af4a2723f0e362c38 (patch)
tree9d16e757b3e30daa38a0bed1eb276a8bb26b3ac6 /tests
parente118a7d97b964a3146c35139da92d6514eb3b235 (diff)
downloadsemanticscuttle-ef23f01ebab448f10cb3935af4a2723f0e362c38.tar.gz
semanticscuttle-ef23f01ebab448f10cb3935af4a2723f0e362c38.tar.bz2
begin supporting a different database for unit tests
Diffstat (limited to 'tests')
-rw-r--r--tests/TestBaseApi.php7
-rw-r--r--tests/prepare.php4
2 files changed, 6 insertions, 5 deletions
diff --git a/tests/TestBaseApi.php b/tests/TestBaseApi.php
index 2caa701..31797c9 100644
--- a/tests/TestBaseApi.php
+++ b/tests/TestBaseApi.php
@@ -50,8 +50,9 @@ class TestBaseApi extends TestBase
$this->url = $GLOBALS['unittestUrl'] . $this->urlPart;
//clean up before test
- if (file_exists($GLOBALS['datadir'] . '/config.unittest.php')) {
- unlink($GLOBALS['datadir'] . '/config.unittest.php');
+ $configFile = $GLOBALS['datadir'] . '/config.testing-tmp.php';
+ if (file_exists($configFile)) {
+ unlink($configFile);
}
$this->us = SemanticScuttle_Service_Factory::get('User');
@@ -230,7 +231,7 @@ class TestBaseApi extends TestBase
$this->assertInternalType(
'integer',
- file_put_contents($GLOBALS['datadir'] . '/config.unittest.php', $str),
+ file_put_contents($GLOBALS['datadir'] . '/config.testing-tmp.php', $str),
'Writing config.unittest.php failed'
);
}
diff --git a/tests/prepare.php b/tests/prepare.php
index c80306e..ea4d77d 100644
--- a/tests/prepare.php
+++ b/tests/prepare.php
@@ -22,7 +22,7 @@ $_SERVER['HTTP_HOST'] = 'http://localhost/';
define('UNIT_TEST_MODE', true);
if ('@data_dir@' == '@' . 'data_dir@') {
- //non pear-install
+ //non pear-installation (i.e. git checkout)
require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php';
} else {
//pear installation; files are in include path
@@ -35,7 +35,7 @@ if ($GLOBALS['debugMode'] == true
&& $GLOBALS['dbtype'] == 'mysql4'
) {
echo "\n"
- . '!!! The combination of debugMode and dbtype==mysql4'
+ . '!! The combination of debugMode and dbtype==mysql4'
. ' will wreck some tests' . "\n\n";
}
?> \ No newline at end of file