[BUGFIX] Do not create folder in wrong directory 83/43283/3
authorHelmut Hummel <helmut.hummel@typo3.org>
Sun, 13 Sep 2015 21:50:51 +0000 (23:50 +0200)
committerNicole Cordes <typo3@cordes.co>
Sun, 13 Sep 2015 23:02:34 +0000 (01:02 +0200)
The testing bootstrap creates several folder so that
the tests can run properly. However this is also done
if the tests are executed from a wrong directory
which makes the tests fail. The folders are created anyways.

To fix this we check for an essential file right after the
directory path is determined.

Resolves: #69767
Releases: master
Change-Id: Ic85a12bd1f682b4e45e39031a1b3bda69f0afcdc
Reviewed-on: http://review.typo3.org/43283
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/core/Build/FunctionalTestsBootstrap.php
typo3/sysext/core/Build/UnitTestsBootstrap.php

index d396e2b..8fcc8ef 100644 (file)
@@ -76,6 +76,10 @@ class FunctionalTestsBootstrap {
                        define('ORIGINAL_ROOT', $this->getWebRoot());
                }
 
+               if (!file_exists(ORIGINAL_ROOT . 'typo3/cli_dispatch.phpsh')) {
+                       die('Unable to determine path to entry script. Please check your path or set an environment variable \'TYPO3_PATH_WEB\' to your root path.');
+               }
+
                return $this;
        }
 
index e017900..ef6db85 100644 (file)
@@ -95,6 +95,10 @@ class UnitTestsBootstrap {
                define('PATH_thisScript', PATH_site . 'typo3/cli_dispatch.phpsh');
                $_SERVER['SCRIPT_NAME'] = PATH_thisScript;
 
+               if (!file_exists(PATH_thisScript)) {
+                       die('Unable to determine path to entry script. Please check your path or set an environment variable \'TYPO3_PATH_WEB\' to your root path.');
+               }
+
                return $this;
        }