punktDe/pt_extbase

How to execute unit tests?

bschmitt opened this issue · 3 comments

I want to use Tx_PtExtbase_Tests_Unit_AbstractBaseTestcase for my extbase extension unit tests too but I'm struggling to:
a) execute the pt_extbase unit tests
b) execute unit tests of my extension which are based on the abstract class.

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

Any help appreciated (TYPO3 6.2)

Hello,

I use phpunit as follows:
-php location- -phpunit location- -config.xml location- -tests location-
example:
/usr/bin/php vendor/bin/phpunit --configuration web/typo3conf/ext/drotalion_test_extension/Configuration/PhpUnit/UnitTests.xml web/typo3conf/ext/drotalion_extension/Tests/Unit

I quite don't understand your question though. Do you want to execute all tests, which inherits from AbstractBaseTestcase?

Have a nice day

Thanks for your answer!
Can you show me how your UnitTests.xml looks like?

The problem is that my extension unit tests can't find Tx_PtExtbase_Tests_Unit_AbstractBaseTestcase. Regarding my question in a) I wanted to know how the pt_extbase unit tests can be executed to prove if my PHPUnit setup with composer etc is correct. I find it really hard to get any documentation regarding extbase unit tests in 6.2 and how to execute them.

Hey,

I can't ensure that it works with 6.2, I am using 7.6 here. My XML file is nothing special, looks like this:

<?xml version="1.0"?>
<phpunit processIsolation="false">
	<testsuites>
		<testsuite name="Drotalion TYPO3 Unit Tests">
			<directory suffix="Test.php">../../../../drotalion_*/Tests/Unit</directory>
		</testsuite>
	</testsuites>
  <logging>
    <log type="junit" target="../../../../../../../build/logs/UnitTests.xml" logIncompleteSkipped="false"/>
  </logging>
	<php>
		<var name="UNIT_TEST_DOMAIN" value="<your url>" />
	</php>
</phpunit>

Question: You prob. use php 56 with typo3 6.2. Which Phpunit version are you using (according to your composer)? I can ensure, that phpunit 4.x works fine with php56. According to phpunit homepage also phpunit 5.x