From 4ed258bb0592ae98f0ff17dade163c19a729d5b0 Mon Sep 17 00:00:00 2001 From: michalsn Date: Tue, 29 Sep 2020 15:05:35 +0200 Subject: [PATCH] DB config load changes --- .github/workflows/test-phpunit.yml | 3 +-- app/Config/Database.php | 15 ------------- tests/_support/Config/Registrar.php | 34 +++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 tests/_support/Config/Registrar.php diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index cf3a2101785f..9229003ba611 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -89,14 +89,13 @@ jobs: TERM: xterm-256color - name: Run Coveralls - if: ${{ success() }} run: | composer global require twinh/php-coveralls php-coveralls --coverage_clover=build/logs/clover.xml -v env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_PARALLEL: true - COVERALLS_FLAG_NAME: php-${{ matrix.php-versions }} + COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }} coveralls-finish: needs: [tests] diff --git a/app/Config/Database.php b/app/Config/Database.php index 9128f48905ae..a0b46c35f45a 100644 --- a/app/Config/Database.php +++ b/app/Config/Database.php @@ -88,21 +88,6 @@ public function __construct() if (ENVIRONMENT === 'testing') { $this->defaultGroup = 'tests'; - - // Under Github Actions, we can set an ENV var named 'DB' - // so that we can test against multiple databases. - if ($group = getenv('DB')) - { - if (is_file(TESTPATH . '_github/Database.php')) - { - require TESTPATH . '_github/Database.php'; - - if (! empty($dbconfig) && array_key_exists($group, $dbconfig)) - { - $this->tests = $dbconfig[$group]; - } - } - } } } diff --git a/tests/_support/Config/Registrar.php b/tests/_support/Config/Registrar.php new file mode 100644 index 000000000000..0317ea8badd1 --- /dev/null +++ b/tests/_support/Config/Registrar.php @@ -0,0 +1,34 @@ +