oliverklee / ext-oelib

TYPO3 library extension "oelib"
https://www.oliverklee.de/typo3-services/seminarmanager/
GNU General Public License v2.0
0 stars 8 forks source link
hacktoberfest php typo3 typo3-cms-extension

"One Is Enough" library TYPO3 extension

TYPO3 V11 TYPO3 V12 License Total Downloads GitHub CI Status Coverage Status

This extension provides useful stuff for extension development: helper functions for unit testing, templating and automatic configuration checks.

Most of the documentation is in ReST format in the Documentation/ folder and is rendered as part of the TYPO3 documentation.

Running the tests locally

You will need to have a Git clone of the extension for this with the Composer dependencies installed.

Running the unit tests

On the command line

To run all unit tests on the command line:

composer ci:tests:unit

To run all unit tests in a directory or file (using the directory Tests/Unit/Model/ as an example):

.Build/vendor/bin/phpunit -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml Tests/Unit/Model/

In PhpStorm

First, you need to configure the path to PHPUnit in the settings:

Languages & Frameworks > PHP > Test Frameworks

In this section, configure PhpStorm to use the Composer autoload and the script path .Build/vendor/autoload.php within your project.

In the Run/Debug configurations for PHPUnit, use an alternative configuration file:

.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml

Running the functional tests

You will need a local MySQL user that has the permissions to create new databases.

In the examples, the following credentials are used:

You will need to provide those credentials as environment variables when running the functional tests:

On the command line

To run all functional tests on the command line:

typo3DatabaseUsername=typo3 typo3DatabasePassword=typo3pass typo3DatabaseName=typo3_test composer ci:tests:functional

To run all functional tests in a directory or file (using the directory Tests/Functional/Authentication/ as an example):

typo3DatabaseUsername=typo3 typo3DatabasePassword=typo3pass typo3DatabaseName=typo3_test .Build/vendor/bin/phpunit -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml Tests/Functional/Authentication/

In PhpStorm

First, you need to configure the path to PHPUnit in the settings:

Languages & Frameworks > PHP > Test Frameworks

In this section, configure PhpStorm to use the Composer autoload and the script path .Build/vendor/autoload.php within your project.

In the Run/Debug configurations for PHPUnit, use an alternative configuration file:

.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml

Also set the following environment variables in your runner configuration: