fembooru/tests/test_install.php

43 lines
1.1 KiB
PHP
Raw Normal View History

<?php
2014-02-17 15:45:42 -05:00
$options = getopt("d:");
$db = $options["d"];
require_once('lib/simpletest/autorun.php');
require_once('lib/simpletest/unit_tester.php');
2014-02-17 15:03:27 -05:00
require_once('lib/simpletest/web_tester.php');
require_once('lib/simpletest/reporter.php');
class ShimmieSimpleTestCase extends WebTestCase {
2014-02-17 15:53:22 -05:00
function testInstallShimmie()
{
$this->get('http://127.0.0.1/');
$this->assertResponse(200);
2014-02-17 15:45:42 -05:00
$this->assertTitle("Shimmie Installation");
$this->assertText("Database Install");
$this->setField("database_type", $this->database);
$this->assertField("database_host", "localhost");
if ($db === "mysql") {
$this->setField("database_user", "root");
$this->setField("database_password", "");
} elseif ($db === "pgsql") {
$this->setField("database_user", "postgres");
$this->setField("database_password", "");
}
$this->assertField("database_name", "shimmie");
2014-02-18 03:32:05 -05:00
$this->clickSubmit("Go!");
if (!$this->assertTitle("Welcome to Shimmie")) {
$this->showSource();
}
2014-02-18 03:32:05 -05:00
$this->assertText("Welcome to Shimmie");
$this->assertText("This message will go away once your first image");
}
}