fembooru/tests/test_install.php

43 lines
1.1 KiB
PHP
Raw Normal View History

<?php
2014-02-18 16:59:07 -05:00
/**
* SimpleTest integration with Travis CI for Shimmie
*
* @package Shimmie
* @author jgen <jeffgenovy@gmail.com>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* @copyright Copyright (c) 2014, jgen
*/
class ShimmieInstallerTest extends WebTestCase {
2014-02-17 15:53:22 -05:00
function testInstallShimmie()
{
2014-02-18 16:28:43 -05:00
$db = constant("_TRAVIS_DATABASE");
2014-02-18 15:41:42 -05:00
// Make sure that we know what database to use.
2014-02-18 16:28:43 -05:00
$this->assertFalse(empty($db));
2014-02-18 15:41:42 -05:00
$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");
2014-02-18 16:28:43 -05:00
$this->setField("database_type", $db);
$this->assertField("database_host", "localhost");
2014-02-18 16:28:43 -05:00
if ($db === "mysql") {
$this->setField("database_user", "root");
$this->setField("database_password", "");
2014-02-18 16:28:43 -05:00
} 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->assertText("Installation Succeeded!")) {
$this->showSource();
}
}
}