All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

Automated testing

From TYPO3Wiki
Jump to: navigation, search

<< Back to Document matrix

see also: Category:PHPUnit

Overview of automated testing possibilities TYPO3 ships with its core

TYPO3 provides a wide variety of automated tests which constantly make sure key functionality is working properly. The developers are constantly improving the environment and add new tests. This page describes what kind of tests are available, where one can follow the process of success and failure of tests and how to run them on a local environment.

This is only a short overview. To gain in depth knowledge about the several testing suites, follow the provided links

Continuous testing with Travis CI

The TYPO3 project uses the service provided by Travis CI to execute all available tests upon each merge to every branch. Each build tackles all PHP versions this branch of TYPO3 is supposed to support.

You can see the current and past activity and states on the Travis CI webpage.

Unit Tests

TYPO3 uses Unit tests in a professional way, (I mean automated execution) since version 6.0. Since then, the suite is continuously growing. In the moment of writing, we execute 8169 tests.

In a local environment, the unit tests may be executed by following command:

cd <docroot>/typo3_src
./bin/phpunit --colors -c typo3/sysext/core/Build/UnitTests.xml -d memory_limit=1024M

Learn more about Unit Tests in TYPO3.

Functional Tests

Functional Tests are part of the core since version 6.2. They require a full blown TYPO3 environment and a database user permitted to create databases. Per test file one environment is bootstrapped and removed after all tests have been executed. Here is how to run them:

cd <docroot>/typo3_src
typo3DatabaseName='foo' typo3DatabaseHost='' typo3DatabaseUsername='root' typo3DatabasePort='3307' typo3DatabasePassword='<password>' bin/phpunit --colors -c typo3/sysext/core/Build/FunctionalTests.xml

Learn more about Functional Tests in TYPO3.

Acceptance Tests

Acceptance Tests are executed automatically since the kickoff of the v8 development. They require a full blown TYPO3 environment, a phantomjs executable and a database user permitted to create databases. For all tests one environment is created and removed after all tests have been executed.

Start the selenium server:

./bin/selenium-server-standalone >/dev/null 2>&1 & php -S >/dev/null 2>&1 & sleep 3;

Here is how to run the tests:

cd <docroot>/typo3_src
typo3DatabaseName='foo' typo3DatabaseHost='localhost' typo3DatabaseUsername='root' typo3DatabasePassword='<password>' ./bin/codecept run acceptance -c typo3/sysext/core/Build/AcceptanceTests.yml typo3/sysext/core/Tests/Acceptance

Learn more about Acceptance Tests in TYPO3.