Use a constant instead.
This commit is contained in:
parent
cc88a33088
commit
74748d55c0
1 changed files with 8 additions and 10 deletions
|
@ -7,35 +7,33 @@ if (empty($db)){
|
|||
die("Error: need to specifiy a database for the test environment.");
|
||||
}
|
||||
|
||||
define("_TRAVIS_DATABASE", $db);
|
||||
|
||||
require_once('lib/simpletest/autorun.php');
|
||||
require_once('lib/simpletest/unit_tester.php');
|
||||
require_once('lib/simpletest/web_tester.php');
|
||||
require_once('lib/simpletest/reporter.php');
|
||||
|
||||
class ShimmieSimpleTestCase extends WebTestCase {
|
||||
var $database;
|
||||
|
||||
function ShimmieTestCase() {
|
||||
$this->database = $db;
|
||||
}
|
||||
|
||||
function testInstallShimmie()
|
||||
{
|
||||
$db = constant("_TRAVIS_DATABASE");
|
||||
|
||||
// Make sure that we know what database to use.
|
||||
$this->assertFalse(empty($this->database));
|
||||
$this->assertFalse(empty($db));
|
||||
|
||||
$this->get('http://127.0.0.1/');
|
||||
$this->assertResponse(200);
|
||||
$this->assertTitle("Shimmie Installation");
|
||||
$this->assertText("Database Install");
|
||||
|
||||
$this->setField("database_type", $this->database);
|
||||
$this->setField("database_type", $db);
|
||||
$this->assertField("database_host", "localhost");
|
||||
|
||||
if ($this->database === "mysql") {
|
||||
if ($db === "mysql") {
|
||||
$this->setField("database_user", "root");
|
||||
$this->setField("database_password", "");
|
||||
} elseif ($this->database === "pgsql") {
|
||||
} elseif ($db === "pgsql") {
|
||||
$this->setField("database_user", "postgres");
|
||||
$this->setField("database_password", "");
|
||||
}
|
||||
|
|
Reference in a new issue