From 2935a87073a980032a9398498f56cbae0930c293 Mon Sep 17 00:00:00 2001 From: jgen Date: Tue, 18 Feb 2014 17:18:25 -0500 Subject: [PATCH] Refactoring: Move the installer related test case into another file. --- .travis.yml | 2 +- tests/all_tests.php | 28 ++++++++++++++++++++++++++++ tests/test_install.php | 14 +------------- 3 files changed, 30 insertions(+), 14 deletions(-) create mode 100644 tests/all_tests.php diff --git a/.travis.yml b/.travis.yml index 37ef474f..62d1ecb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ before_script: - 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 +script: php tests/all_tests.php -d $DB # If a failure occured then dump out a bunch of logs for debugging purposes. after_failure: diff --git a/tests/all_tests.php b/tests/all_tests.php new file mode 100644 index 00000000..6bc00670 --- /dev/null +++ b/tests/all_tests.php @@ -0,0 +1,28 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * @copyright Copyright (c) 2014, jgen + */ + +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'); + + +$options = getopt("d:"); +$db = $options["d"]; + +if (empty($db)){ die("Error: need to specifiy a database for the test environment."); } + +define("_TRAVIS_DATABASE", $db); + +$test_suite = new TestSuite('Shimmie tests'); +$test_suite->add(new ShimmieInstallerTest()); + +$tr = new TextReporter(); +$test_suite->run( $tr ); diff --git a/tests/test_install.php b/tests/test_install.php index 6846bd3d..fc9b6224 100644 --- a/tests/test_install.php +++ b/tests/test_install.php @@ -8,19 +8,7 @@ * @copyright Copyright (c) 2014, jgen */ -$options = getopt("d:"); -$db = $options["d"]; - -if (empty($db)){ die("Error: need to specifiy a database for the test environment."); } - -define("_TRAVIS_DATABASE", $db); - -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'); - -class ShimmieSimpleTestCase extends WebTestCase { +class ShimmieInstallerTest extends WebTestCase { function testInstallShimmie() { $db = constant("_TRAVIS_DATABASE");