From a5907c5a79692787c1b11af6807778049d272b98 Mon Sep 17 00:00:00 2001 From: jgen Date: Wed, 19 Feb 2014 00:40:16 -0500 Subject: [PATCH] Cleaning up a bit. --- .travis.yml | 10 +++++++--- tests/all_tests.php | 9 +++++---- tests/setup_test_env.sh | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1b1a386..177b76b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: php -# list the versions of PHP you want to test against + php: +# Here is where we can list the versions of PHP you want to test against # using major version aliases - 5.3 @@ -14,10 +15,13 @@ before_install: - sudo chmod u+x tests/setup_test_env.sh install: + # Install nginx, php5-fpm and configure them - sudo ./tests/setup_test_env.sh $TRAVIS_BUILD_DIR + + # Create the database schema for shimmie. - if [[ "$DB" == "pgsql" ]]; then psql -c "DROP DATABASE IF EXISTS shimmie;" -U postgres; fi - - if [[ "$DB" == "pgsql" ]]; then psql -c "create database shimmie;" -U postgres; fi - - if [[ "$DB" == "mysql" ]]; then mysql -e "create database shimmie;" -uroot; fi + - if [[ "$DB" == "pgsql" ]]; then psql -c "CREATE DATABASE shimmie;" -U postgres; fi + - if [[ "$DB" == "mysql" ]]; then mysql -e "CREATE DATABASE shimmie;" -uroot; fi script: - php tests/test_install.php -d $DB diff --git a/tests/all_tests.php b/tests/all_tests.php index 7f23aa78..c60b5a90 100644 --- a/tests/all_tests.php +++ b/tests/all_tests.php @@ -12,14 +12,12 @@ require_once('lib/simpletest/autorun.php'); require_once('lib/simpletest/unit_tester.php'); require_once('lib/simpletest/web_tester.php'); require_once('lib/simpletest/reporter.php'); -require_once('ext/simpletest/main.php'); // Enable all errors. error_reporting(E_ALL); -// -// The code below is from index.php -// +// The code below is based on the code in index.php +//-------------------------------------------------- require_once "core/sys_config.inc.php"; require_once "core/util.inc.php"; @@ -34,6 +32,9 @@ foreach($files as $filename) { require_once $filename; } +// We also need to pull in the SimpleTest extension. +require_once('ext/simpletest/main.php'); + // connect to the database $database = new Database(); $config = new DatabaseConfig($database); diff --git a/tests/setup_test_env.sh b/tests/setup_test_env.sh index ff239175..deb3e917 100644 --- a/tests/setup_test_env.sh +++ b/tests/setup_test_env.sh @@ -11,7 +11,7 @@ set -e # Install the necessary packages -sudo apt-get install -y nginx realpath php5-fpm php5-mysql --fix-missing +sudo apt-get install -y nginx php5-fpm php5-mysql realpath --fix-missing # Stop the daemons sudo service nginx stop