Refactoring: Move the installer related test case into another file.

This commit is contained in:
jgen 2014-02-18 17:18:25 -05:00
parent 66f32e63cf
commit 2935a87073
3 changed files with 30 additions and 14 deletions

View file

@ -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:

28
tests/all_tests.php Normal file
View file

@ -0,0 +1,28 @@
<?php
/**
* 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
*/
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 );

View file

@ -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");