Skip to content

Commit

Permalink
Add unit tests to CI workflow and streamline CI and testing config
Browse files Browse the repository at this point in the history
  • Loading branch information
helhum committed Oct 13, 2021
1 parent d46c8ca commit 2fd2de7
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,3 +1,3 @@
/.Build
/.phpunit.result.cache
.phpunit.result.cache
/composer.lock
15 changes: 14 additions & 1 deletion Tests/Build/FunctionalTests.xml
Expand Up @@ -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
-->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="true" bootstrap="../../../../../../vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php" colors="true" convertErrorsToExceptions="true" convertWarningsToExceptions="true" forceCoversAnnotation="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" verbose="false" beStrictAboutTestsThatDoNotTestAnything="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="true"
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="false"
beStrictAboutTestsThatDoNotTestAnything="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>../../Classes/</directory>
Expand Down
1 change: 0 additions & 1 deletion Tests/Build/UnitTests.xml
@@ -1,6 +1,5 @@
<phpunit
backupGlobals="true"
bootstrap="../../../../../../vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
Expand Down
11 changes: 11 additions & 0 deletions Tests/Unit/FactProvider/BrowserAcceptedLanguageTest.php
@@ -1,5 +1,16 @@
<?php

declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* Florian Wessels <f.wessels@Leuchtfeuer.com>, Leuchtfeuer Digital Marketing
*/

namespace Leuchtfeuer\Locate\Tests\Unit\FactProvider;

use Leuchtfeuer\Locate\FactProvider\BrowserAcceptedLanguage;
Expand Down
11 changes: 11 additions & 0 deletions Tests/Unit/FactProvider/IP2CountryTest.php
@@ -1,5 +1,16 @@
<?php

declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* Florian Wessels <f.wessels@Leuchtfeuer.com>, Leuchtfeuer Digital Marketing
*/

namespace Leuchtfeuer\Locate\Tests\Unit\FactProvider;

use Leuchtfeuer\Locate\FactProvider\IP2Country;
Expand Down

0 comments on commit 2fd2de7

Please sign in to comment.