diff --git a/tests/test_install.php b/tests/test_install.php index fe4d2d50..46b012c3 100644 --- a/tests/test_install.php +++ b/tests/test_install.php @@ -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", ""); }