This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/tests/test_install.php

46 lines
1.2 KiB
PHP
Raw Normal View History

<?php
2014-02-17 20:45:42 +00:00
$options = getopt("d:");
$db = $options["d"];
require_once('lib/simpletest/autorun.php');
require_once('lib/simpletest/unit_tester.php');
2014-02-17 20:03:27 +00:00
require_once('lib/simpletest/web_tester.php');
require_once('lib/simpletest/reporter.php');
class ShimmieSimpleTestCase extends WebTestCase {
var $database;
2014-02-17 20:45:42 +00:00
var $db_user, $db_pass;
function ShimmieTestCase() {
2014-02-17 20:45:42 +00:00
$this->database = $db;
if ($db === "mysql") {
$this->db_user = "root";
2014-02-17 20:45:42 +00:00
$this->db_pass = "";
} elseif ($db === "pgsql") {
$this->db_user = "postgres";
$this->db_pass = "";
}
}
2014-02-17 20:53:22 +00:00
function testInstallShimmie()
{
$this->get('http://127.0.0.1/');
$this->assertResponse(200);
2014-02-17 20:45:42 +00:00
$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");
2014-02-18 08:32:05 +00:00
$this->clickSubmit("Go!");
$this->assertTitle("Welcome to Shimmie");
$this->assertText("Welcome to Shimmie");
$this->assertText("This message will go away once your first image");
}
}