[BUGFIX] Hint to the correct unit test runner 20/24720/3
authorHelmut Hummel <helmut.hummel@typo3.org>
Mon, 14 Oct 2013 08:09:14 +0000 (10:09 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Mon, 14 Oct 2013 10:57:43 +0000 (12:57 +0200)
Running the test suite with the cli dispatcher
does not work as the bootstrap is executed twice.

Give a hint to the correct command instead
of letting it fatal.

Releases: 6.2
Resolves: #52787
Change-Id: Ic1def6ed40959128282ef2b6093066218012aa77
Reviewed-on: https://review.typo3.org/24720
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Build/UnitTestsBootstrap.php

index dc5653b..35fcf9b 100644 (file)
@@ -45,6 +45,20 @@ namespace TYPO3\CMS\Core\Build;
  *     typo3/sysext/core/Tests/Uinit/DataHandling/DataHandlerTest.php
  */
 
+/**
+ * Be nice and give a hint if someone is executing the tests with cli dispatch
+ */
+if (defined('TYPO3_MODE')) {
+       array_shift($_SERVER['argv']);
+       echo 'Please run the unit tests using the following command:' . chr(10);
+       echo sprintf(
+               'typo3conf/ext/phpunit/Composer/vendor/bin/phpunit %s',
+               implode(' ', $_SERVER['argv'])
+       ) . chr(10);
+       echo chr(10);
+       exit(1);
+}
+
 /**
  * Find out web path by environment variable or current working directory
  */