From 2fd2de70607e9e395ecac57941fd1b2405926933 Mon Sep 17 00:00:00 2001 From: Helmut Hummel Date: Tue, 12 Oct 2021 10:16:11 +0200 Subject: [PATCH] Add unit tests to CI workflow and streamline CI and testing config --- .github/workflows/ci.yaml | 5 +++-- .gitignore | 2 +- Tests/Build/FunctionalTests.xml | 15 ++++++++++++++- Tests/Build/UnitTests.xml | 1 - .../FactProvider/BrowserAcceptedLanguageTest.php | 11 +++++++++++ Tests/Unit/FactProvider/IP2CountryTest.php | 11 +++++++++++ 6 files changed, 40 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 380282d..82d4f76 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -96,9 +96,10 @@ jobs: composer req typo3/testing-framework typo3/cms-core:"${{ matrix.typo3-version }}" typo3/cms-backend:"${{ matrix.typo3-version }}" typo3/cms-extbase:"${{ matrix.typo3-version }}" typo3/cms-extensionmanager:"${{ matrix.typo3-version }}" typo3/cms-fluid:"${{ matrix.typo3-version }}" typo3/cms-frontend:"${{ matrix.typo3-version }}" export TYPO3_PATH_WEB=$PWD/.Build/web - - name: Run PHP Unit + - name: Run PHPUnit run: | - .Build/bin/phpunit --colors --configuration Tests/Build/FunctionalTests.xml Tests/Functional --bootstrap .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php --coverage-clover=coverage.xml + .Build/bin/phpunit --configuration Tests/Build/FunctionalTests.xml --coverage-clover=coverage.xml + .Build/bin/phpunit --configuration Tests/Build/UnitTests.xml if [[ "${{ matrix.php-version }}" == "7.4" ]] && [[ "${{ matrix.typo3-version }}" == "^10.4" ]]; then bash <(curl -s https://codecov.io/bash) diff --git a/.gitignore b/.gitignore index 4a4e401..0e618dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /.Build -/.phpunit.result.cache +.phpunit.result.cache /composer.lock diff --git a/Tests/Build/FunctionalTests.xml b/Tests/Build/FunctionalTests.xml index afe8c62..9426a9e 100644 --- a/Tests/Build/FunctionalTests.xml +++ b/Tests/Build/FunctionalTests.xml @@ -8,7 +8,20 @@ TYPO3 CMS functional test suite also needs phpunit bootstrap code, the file is located next to this .xml as FunctionalTestsBootstrap.php --> - + ../../Classes/ diff --git a/Tests/Build/UnitTests.xml b/Tests/Build/UnitTests.xml index 8410fdc..81c98f7 100644 --- a/Tests/Build/UnitTests.xml +++ b/Tests/Build/UnitTests.xml @@ -1,6 +1,5 @@ , Leuchtfeuer Digital Marketing + */ + namespace Leuchtfeuer\Locate\Tests\Unit\FactProvider; use Leuchtfeuer\Locate\FactProvider\BrowserAcceptedLanguage; diff --git a/Tests/Unit/FactProvider/IP2CountryTest.php b/Tests/Unit/FactProvider/IP2CountryTest.php index dae2512..d617923 100644 --- a/Tests/Unit/FactProvider/IP2CountryTest.php +++ b/Tests/Unit/FactProvider/IP2CountryTest.php @@ -1,5 +1,16 @@ , Leuchtfeuer Digital Marketing + */ + namespace Leuchtfeuer\Locate\Tests\Unit\FactProvider; use Leuchtfeuer\Locate\FactProvider\IP2Country;