[TASK] Add CLI option to set DB socket for functional tests 72/32672/2
authorSteffen Müller <typo3@t3node.com>
Tue, 9 Sep 2014 08:52:53 +0000 (10:52 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 9 Sep 2014 10:44:52 +0000 (12:44 +0200)
An additional option "typo3DatabaseSocket" can be set
to configure a custom DB socket when running functional tests
from the commandline interface.

Resolves: #61465
Releases: 6.3, 6.2
Change-Id: If34526264bdc8b91c7c45785dde06a10fb606526
Reviewed-on: http://review.typo3.org/32672
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Tests/FunctionalTestCaseBootstrapUtility.php

index 8a07207..7cdc713 100644 (file)
@@ -269,7 +269,8 @@ class FunctionalTestCaseBootstrapUtility {
                $databaseUsername = getenv('typo3DatabaseUsername');
                $databasePassword = getenv('typo3DatabasePassword');
                $databasePort = getenv('typo3DatabasePort');
-               if ($databaseName || $databaseHost || $databaseUsername || $databasePassword || $databasePort) {
+               $databaseSocket = getenv('typo3DatabaseSocket');
+               if ($databaseName || $databaseHost || $databaseUsername || $databasePassword || $databasePort || $databaseSocket) {
                        // Try to get database credentials from environment variables first
                        $originalConfigurationArray = array(
                                'DB' => array(),
@@ -289,6 +290,9 @@ class FunctionalTestCaseBootstrapUtility {
                        if ($databasePort) {
                                $originalConfigurationArray['DB']['port'] = $databasePort;
                        }
+                       if ($databaseSocket) {
+                               $originalConfigurationArray['DB']['socket'] = $databaseSocket;
+                       }
                } elseif (file_exists(ORIGINAL_ROOT . 'typo3conf/LocalConfiguration.php')) {
                        // See if a LocalConfiguration file exists in "parent" instance to get db credentials from
                        $originalConfigurationArray = require ORIGINAL_ROOT . 'typo3conf/LocalConfiguration.php';