From 7dab02cbd129b89354bcdee6d656230799de369f Mon Sep 17 00:00:00 2001 From: Vance Lucas Date: Fri, 10 Jul 2015 11:11:40 -0500 Subject: [PATCH] Revert "Fix: One phpunit.xml to rule them all" This reverts commit a59b7132051429564393230033e140d60649110a. --- .travis.yml | 11 +++-------- composer.json | 3 ++- phpunit_mysql.xml | 28 ++++++++++++++++++++++++++++ phpunit_pgsql.xml | 28 ++++++++++++++++++++++++++++ phpunit.xml => phpunit_sqlite.xml | 9 +++++++-- tests/init.php | 3 +-- 6 files changed, 69 insertions(+), 13 deletions(-) create mode 100644 phpunit_mysql.xml create mode 100644 phpunit_pgsql.xml rename phpunit.xml => phpunit_sqlite.xml (75%) diff --git a/.travis.yml b/.travis.yml index 4b3c238..65822e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,13 +7,12 @@ cache: directories: - $HOME/.composer/cache -# list any PHP version you want to test against php: - 5.4 - 5.5 - 5.6 + - 7.0 -# optionally specify a list of environments, for example to test different RDBMS env: - TYPE=mysql DSN=mysql://root@localhost/spot_test - TYPE=pgsql DSN=pgsql://postgres@localhost/spot_test" @@ -28,9 +27,5 @@ before_script: - if [[ "$TYPE" == "pgsql" ]]; then psql -c 'create database spot_test;' -U postgres; fi # omitting "script:" will default to phpunit -# use the $SPOT_DB env variable to determine the phpunit.xml to use -script: phpunit --configuration phpunit.xml --coverage-text - -# configure notifications (email, IRC, campfire etc) -#notifications: -# irc: "irc.freenode.org#travis" +# use the $TYPE env variable to determine the phpunit.xml to use +script: phpunit --configuration phpunit_$TYPE.xml --coverage-text diff --git a/composer.json b/composer.json index 9efe4be..4a79ecd 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,8 @@ }, "autoload": { "psr-4": { - "Spot\\": "lib/" + "Spot\\": "lib/", + "SpotTest\\": "tests/" } } } diff --git a/phpunit_mysql.xml b/phpunit_mysql.xml new file mode 100644 index 0000000..ce8a215 --- /dev/null +++ b/phpunit_mysql.xml @@ -0,0 +1,28 @@ + + + + + + + + + + ./tests + + + + + ./lib + + + diff --git a/phpunit_pgsql.xml b/phpunit_pgsql.xml new file mode 100644 index 0000000..1b474ec --- /dev/null +++ b/phpunit_pgsql.xml @@ -0,0 +1,28 @@ + + + + + + + + + + ./tests + + + + + ./lib + + + diff --git a/phpunit.xml b/phpunit_sqlite.xml similarity index 75% rename from phpunit.xml rename to phpunit_sqlite.xml index 1b21ce3..d649fb6 100644 --- a/phpunit.xml +++ b/phpunit_sqlite.xml @@ -10,9 +10,14 @@ syntaxCheck="false" bootstrap="./tests/init.php" > + + + + + - - ./tests/SpotTest + + ./tests diff --git a/tests/init.php b/tests/init.php index fe34b2d..e72c632 100644 --- a/tests/init.php +++ b/tests/init.php @@ -10,14 +10,13 @@ * Autoload test fixtures */ $autoload = require dirname(dirname(__FILE__)) . '/vendor/autoload.php'; -$autoload->add('SpotTest', __DIR__); // Date setup date_default_timezone_set('America/Chicago'); // Setup available adapters for testing $cfg = new \Spot\Config(); -$dbDsn = getenv('DSN'); +$dbDsn = getenv('SPOT_DB_DSN'); if (!empty($dbDsn)) { $cfg->addConnection('test', $dbDsn);