Browse Source

Fix test errors when PostgreSQL or MySQL are not available

tags/0.7.1
J. King 5 months ago
parent
commit
86d52c8ff9
2 changed files with 7 additions and 5 deletions
  1. 6
    4
      tests/cases/Database/Base.php
  2. 1
    1
      tests/cases/DatabaseDrivers/MySQL.php

+ 6
- 4
tests/cases/Database/Base.php View File

@@ -100,10 +100,12 @@ abstract class Base extends \JKingWeb\Arsse\Test\AbstractTest {
}

public static function tearDownAfterClass() {
// wipe the database absolutely clean
static::dbRaze(static::$drv);
// clean up
static::$drv = null;
if (static::$drv) {
// wipe the database absolutely clean
static::dbRaze(static::$drv);
// clean up
static::$drv = null;
}
static::$failureReason = "";
static::clearData();
}

+ 1
- 1
tests/cases/DatabaseDrivers/MySQL.php View File

@@ -18,7 +18,7 @@ trait MySQL {
protected static $stringOutput = true;
public static function dbInterface() {
$d = new \mysqli(Arsse::$conf->dbMySQLHost, Arsse::$conf->dbMySQLUser, Arsse::$conf->dbMySQLPass, Arsse::$conf->dbMySQLDb, Arsse::$conf->dbMySQLPort);
$d = @new \mysqli(Arsse::$conf->dbMySQLHost, Arsse::$conf->dbMySQLUser, Arsse::$conf->dbMySQLPass, Arsse::$conf->dbMySQLDb, Arsse::$conf->dbMySQLPort);
if ($d->connect_errno) {
return;
}

Loading…
Cancel
Save