The location of the webserver should be configurable in the travis file.
This commit is contained in:
parent
cb135d4763
commit
8b0ac0e9c1
@ -24,8 +24,8 @@ install:
|
|||||||
- if [[ "$DB" == "mysql" ]]; then mysql -e "CREATE DATABASE shimmie;" -uroot; fi
|
- if [[ "$DB" == "mysql" ]]; then mysql -e "CREATE DATABASE shimmie;" -uroot; fi
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- php tests/test_install.php -d $DB
|
- php tests/test_install.php -d $DB -h "http://127.0.0.1/"
|
||||||
- php tests/all_tests.php
|
- php tests/all_tests.php -h "http://127.0.0.1/"
|
||||||
|
|
||||||
# If a failure occured then dump out a bunch of logs for debugging purposes.
|
# If a failure occured then dump out a bunch of logs for debugging purposes.
|
||||||
after_failure:
|
after_failure:
|
||||||
|
@ -111,10 +111,14 @@ class SCoreWebTestCase extends WebTestCase {
|
|||||||
*/
|
*/
|
||||||
protected function get_page($page) {
|
protected function get_page($page) {
|
||||||
if($_SERVER['HTTP_HOST'] == "<cli command>") {
|
if($_SERVER['HTTP_HOST'] == "<cli command>") {
|
||||||
// FIXME: this should be a command line option.
|
|
||||||
|
|
||||||
//print "http://127.0.0.1/2.Xm/index.php?q=$page";
|
//print "http://127.0.0.1/2.Xm/index.php?q=$page";
|
||||||
$raw = $this->get("http://127.0.0.1/index.php?q=".str_replace("?", "&", $page));
|
|
||||||
|
$host = constant("_TRAVIS_WEBHOST");
|
||||||
|
// Make sure that we know where the host is.
|
||||||
|
$this->assertFalse(empty($host));
|
||||||
|
|
||||||
|
$raw = $this->get($host."index.php?q=".str_replace("?", "&", $page));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$raw = $this->get(make_http(make_link($page)));
|
$raw = $this->get(make_http(make_link($page)));
|
||||||
|
@ -15,6 +15,14 @@ require_once('lib/simpletest/reporter.php');
|
|||||||
// Enable all errors.
|
// Enable all errors.
|
||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
|
// Get the command line option telling us where the webserver is.
|
||||||
|
$options = getopt("h::");
|
||||||
|
$host = trim($options["h"], "'\"");
|
||||||
|
|
||||||
|
if (empty($host)){ $host = "http://127.0.0.1/"; }
|
||||||
|
|
||||||
|
define("_TRAVIS_WEBHOST", $host);
|
||||||
|
|
||||||
// The code below is based on the code in index.php
|
// The code below is based on the code in index.php
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
|
@ -17,22 +17,28 @@ require_once('lib/simpletest/reporter.php');
|
|||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
// Get the command line option telling us what database to use.
|
// Get the command line option telling us what database to use.
|
||||||
$options = getopt("d:");
|
$options = getopt("d:h::");
|
||||||
$db = $options["d"];
|
$db = $options["d"];
|
||||||
|
$host = trim($options["h"], "'\"");
|
||||||
|
|
||||||
if (empty($db)){ die("Error: need to specifiy a database for the test environment."); }
|
if (empty($db)){ die("Error: need to specifiy a database for the test environment."); }
|
||||||
|
if (empty($host)){ $host = "http://127.0.0.1/"; }
|
||||||
|
|
||||||
define("_TRAVIS_DATABASE", $db);
|
define("_TRAVIS_DATABASE", $db);
|
||||||
|
define("_TRAVIS_WEBHOST", $host);
|
||||||
|
|
||||||
class ShimmieInstallerTest extends WebTestCase {
|
class ShimmieInstallerTest extends WebTestCase {
|
||||||
function testInstallShimmie()
|
function testInstallShimmie()
|
||||||
{
|
{
|
||||||
$db = constant("_TRAVIS_DATABASE");
|
$db = constant("_TRAVIS_DATABASE");
|
||||||
|
$host = constant("_TRAVIS_WEBHOST");
|
||||||
|
|
||||||
|
// Make sure that we know where the host is.
|
||||||
|
$this->assertFalse(empty($host));
|
||||||
// Make sure that we know what database to use.
|
// Make sure that we know what database to use.
|
||||||
$this->assertFalse(empty($db));
|
$this->assertFalse(empty($db));
|
||||||
|
|
||||||
$this->get('http://127.0.0.1/');
|
$this->get($host);
|
||||||
$this->assertResponse(200);
|
$this->assertResponse(200);
|
||||||
$this->assertTitle("Shimmie Installation");
|
$this->assertTitle("Shimmie Installation");
|
||||||
$this->assertText("Database Install");
|
$this->assertText("Database Install");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user