[TYPO3-core] Running core+sysext unit tests from console

Helmut Hummel helmut.hummel at typo3.org
Sat Feb 22 12:36:45 CET 2014


Hi Steffen!

On 19.02.14 00:07, Steffen Müller wrote:
> Hi.
>
> When I try to run the core unit tests on the shell console, I end up in
> PHP fatal errors:
>
> $ ./typo3conf/ext/phpunit/Composer/vendor/bin/phpunit -c
> typo3/sysext/core/Build/UnitTests.xml
>
> PHP Fatal error:  Class
> 'TYPO3\CMS\Documentation\Domain\Model\DocumentFormat' not found in
> /home/steffen/Projects/TYPO3/CMS/typo3_src-master/typo3/sysext/documentation/Tests/Unit/Domain/Model/DocumentFormatTest.php
> on line 38
>
> Seems like the errors occur because not all sysexts are activated in my
> test environment.

It depends what you want to achieve. You cannot execute test that belong 
to one extension without activating it.

But if you want to execute tests of only one extension, you can 
additonally pass a test folder or even a test class to the command:

./typo3conf/ext/phpunit/Composer/vendor/bin/phpunit -c 
typo3/sysext/core/Build/UnitTests.xml typo3/sysext/core/Tests/Unit/

This would only execute the unit tests for the core extension.

If you want to execute more tests (folders), just pass the paths along 
separated by space.

You could also copy the configuration file 
typo3/sysext/core/Build/UnitTests.xml and edit the test suit part of it 
to fit your needs.


Kind regards,
Helmut

-- 
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 Core Developer, TYPO3 Security Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the TYPO3-team-core mailing list