Commit c5e1d285 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Update phpUnit Tests to new multi database setup

parent 85c4b711
......@@ -71,8 +71,12 @@ abstract class AbstractDatabaseTest extends PHPUnit_Framework_TestCase {
$this->sip->sipUniqId('badcaffee1234');
// SWITCH to TestDB
$dbName = $this->store->getVar('DB_1_NAME', STORE_SYSTEM);
$this->store->setVar('DB_1_NAME', $dbName, STORE_SYSTEM);
$dbNamePhpUnit = $this->store->getVar('dbNamePhpUnit', STORE_SYSTEM . STORE_EMPTY);
if ($dbNamePhpUnit == '') {
$dbNamePhpUnit = $this->store->getVar('DB_1_NAME', STORE_SYSTEM) . '_phpunit';
$this->store->setVar('dbNamePhpUnit', $dbNamePhpUnit, STORE_SYSTEM);
}
$this->store->setVar('DB_1_NAME', $dbNamePhpUnit, STORE_SYSTEM);
if (empty($this->dbArray)) {
$this->dbArray[DB_INDEX_DATA_DEFAULT] = new qfq\Database();
......
......@@ -255,7 +255,7 @@ class DatabaseTest extends AbstractDatabaseTest {
$rc = $this->dbArray[DB_INDEX_DATA_DEFAULT]->sql($sql, ROW_REGULAR, $dummy, 'fake', $dummy, $stat);
// DB_NUM_ROWS | DB_INSERT_ID | DB_AFFECTED_ROWS
$this->assertEquals(14, $stat[DB_NUM_ROWS]);
$this->assertEquals(10, $stat[DB_NUM_ROWS]);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment