[TASK] Integrate driver into functional test bootstrap 14/50914/4
authorManuel Selbach <manuel_selbach@yahoo.de>
Fri, 9 Dec 2016 09:47:11 +0000 (10:47 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 23 Dec 2016 17:50:48 +0000 (18:50 +0100)
According to doctrine migration functional tests should be processed against
different dbms. Thus, we have to integrate the driver to the bootstrap. The
driver can be set by environment variable name 'typo3DatabaseDriver'.

Change-Id: Ia725285a695fbb0e11555c7371cfd2165ba30d77
Resolves: #78930
Releases: master
Reviewed-on: https://review.typo3.org/50914
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Manuel Selbach <manuel_selbach@yahoo.de>
Tested-by: Manuel Selbach <manuel_selbach@yahoo.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
components/testing_framework/core/Testbase.php

index 6a56ac6..6cd5098 100644 (file)
@@ -317,6 +317,7 @@ class Testbase
         $databasePasswordTrimmed = trim($databasePassword);
         $databasePort = trim(getenv('typo3DatabasePort'));
         $databaseSocket = trim(getenv('typo3DatabaseSocket'));
+        $databaseDriver = trim(getenv('typo3DatabaseDriver'));
         if ($databaseName || $databaseHost || $databaseUsername || $databasePassword || $databasePort || $databaseSocket) {
             // Try to get database credentials from environment variables first
             $originalConfigurationArray = [
@@ -346,6 +347,9 @@ class Testbase
             if ($databaseSocket) {
                 $originalConfigurationArray['DB']['Connections']['Default']['unix_socket'] = $databaseSocket;
             }
+            if ($databaseDriver) {
+                $originalConfigurationArray['DB']['Connections']['Default']['driver'] = $databaseDriver;
+            }
         } 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';