[TYPO3-english] Re: Unit testing in an existing installation - TYPO3 7.6.9

Viktor Livakivskyi invisible.kinder at gmail.com
Mon Jun 20 10:02:02 CEST 2016


Hi, Jennifer.

I'm doing testing with standalone PhpUnit installation (done via Composer, as well as TYPO3 and extension installation).
And I have following XML config in my root:

<phpunit
	backupGlobals="true"
	backupStaticAttributes="false"
	bootstrap="typo3_src/typo3/sysext/core/Build/UnitTestsBootstrap.php"
	colors="true"
	convertErrorsToExceptions="true"
	convertWarningsToExceptions="true"
	forceCoversAnnotation="false"
	processIsolation="false"
	stopOnError="false"
	stopOnFailure="false"
	stopOnIncomplete="false"
	stopOnSkipped="false"
	verbose="false"
>
	<testsuites>
		<testsuite name="Registration Extender">
			<directory>www/typo3conf/ext/my_registration_extender/Tests/Unit/</directory>
		</testsuite>
		<testsuite name="My Ext">
			<directory>www/typo3conf/ext/my_ext/Tests/Unit/</directory>
		</testsuite>
	</testsuites>
	<filter>
		<whitelist>
			<directory>www/typo3conf/ext/my_registration_extender/Classes/</directory>
			<directory>www/typo3conf/ext/my_ext/Classes/</directory>
		</whitelist>
	</filter>
</phpunit>

And running tests with following command:
/bin/phpunit -c UnitTests.xml 

I don't think, that there is a difference between new and existing installation, except fact, that existing installation may by installed without Composer. In this case you still need PhpUnit to be installed with composer, but then TYPO3 bootstrap will take care of class loading.


More information about the TYPO3-english mailing list