[BUGFIX] Improve resolving path to autoload.php 57/42557/2
authorNicole Cordes <typo3@cordes.co>
Thu, 13 Aug 2015 08:54:38 +0000 (10:54 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 16 Aug 2015 01:20:02 +0000 (03:20 +0200)
The patch improves the resolving of autoload.php for unit and
functional tests to be able to run tests in Windows system with
symlinked core.

Resolves: #69011
Releases: master
Change-Id: I13cca3e1a2bca6f00c9094436a5a82fdf6325562
Reviewed-on: http://review.typo3.org/42557
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/core/Build/UnitTestsBootstrap.php
typo3/sysext/core/Tests/FunctionalTestCaseBootstrapUtility.php

index b4578bc..806cd64 100644 (file)
@@ -171,7 +171,7 @@ class UnitTestsBootstrap {
         * @return UnitTestsBootstrap fluent interface
         */
        protected function includeAndStartCoreBootstrap() {
-               $classLoaderFilepath = PATH_site . '/typo3/../vendor/autoload.php';
+               $classLoaderFilepath = __DIR__ . '/../../../../vendor/autoload.php';
                if (!file_exists($classLoaderFilepath)) {
                        die('ClassLoader can\'t be loaded. Please check your path or set an environment variable \'TYPO3_PATH_WEB\' to your root path.');
                }
index e293577..5af0970 100644 (file)
@@ -424,7 +424,7 @@ class FunctionalTestCaseBootstrapUtility {
                define('TYPO3_MODE', 'BE');
                define('TYPO3_cliMode', TRUE);
 
-               $classLoader = require $this->instancePath . '/typo3/../vendor/autoload.php';
+               $classLoader = require rtrim(realpath($this->instancePath . '/typo3'), '\\/') . '/../vendor/autoload.php';
                \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
                        ->initializeClassLoader($classLoader)
                        ->baseSetup('')