Working on testing the installer.
This commit is contained in:
parent
630f5c2c77
commit
48932af7c5
@ -1,28 +1,47 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$options = getopt("d:");
|
||||||
|
$db = $options["d"];
|
||||||
|
|
||||||
require_once('lib/simpletest/autorun.php');
|
require_once('lib/simpletest/autorun.php');
|
||||||
require_once('lib/simpletest/unit_tester.php');
|
require_once('lib/simpletest/unit_tester.php');
|
||||||
require_once('lib/simpletest/web_tester.php');
|
require_once('lib/simpletest/web_tester.php');
|
||||||
require_once('lib/simpletest/reporter.php');
|
require_once('lib/simpletest/reporter.php');
|
||||||
|
|
||||||
class ShimmieSimpleTestCase extends WebTestCase {
|
class ShimmieSimpleTestCase extends WebTestCase {
|
||||||
var $options;
|
|
||||||
var $database;
|
var $database;
|
||||||
|
var $db_user, $db_pass;
|
||||||
|
|
||||||
function ShimmieTestCase() {
|
function ShimmieTestCase() {
|
||||||
$this->options = getopt("d:");
|
$this->database = $db;
|
||||||
$this->database = $this->options["d"];
|
|
||||||
|
if ($db === "mysql") {
|
||||||
|
$this->db_user = "travis";
|
||||||
|
$this->db_pass = "";
|
||||||
|
} elseif ($db === "pgsql") {
|
||||||
|
$this->db_user = "postgres";
|
||||||
|
$this->db_pass = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function testOptions() {
|
function testOptions() {
|
||||||
print_r($this->options);
|
echo $this->database;
|
||||||
$this->assertNotNull($this->database);
|
//$this->assertFalse(is_null($this->database));
|
||||||
}
|
}
|
||||||
|
|
||||||
function installShimmie()
|
function installShimmie()
|
||||||
{
|
{
|
||||||
$this->get('http://127.0.0.1/');
|
$this->get('http://127.0.0.1/');
|
||||||
$this->assertResponse(200);
|
$this->assertResponse(200);
|
||||||
|
$this->assertTitle("Shimmie Installation");
|
||||||
|
$this->assertText("Database Install");
|
||||||
|
|
||||||
|
$this->setFieldById("database_type", $this->database);
|
||||||
|
$this->assertFieldByName("database_host", "localhost");
|
||||||
|
$this->setFieldByName("database_user", $this->db_user);
|
||||||
|
$this->setFieldByName("database_password", $this->db_pass);
|
||||||
|
$this->assertFieldByName("database_name", "shimmie");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user