[TASK] Create functional test databases with UTF8 character set/collation 68/45368/2
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 18 Dec 2015 21:31:08 +0000 (22:31 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 11 Jan 2016 16:33:10 +0000 (17:33 +0100)
Change the create database statements in the functional test setup to
ensure an UTF-8 character set and collation. Otherwise the tests use the
default collation of the server which could lead to database being
created with Non-UTF-8 character sets like latin1_swedish_ci which is
widely in use as a default character set.

Resolves: #67474
Releases: master
Change-Id: Iefdb686a7ceb23e7934702904d16e7d44ae88839
Reviewed-on: https://review.typo3.org/45368
Reviewed-by: Richard Haeser <richardhaeser@gmail.com>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Frank N├Ągler <frank.naegler@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Tests/FunctionalTestCaseBootstrapUtility.php

index d1bcd31..acac233 100644 (file)
@@ -494,7 +494,7 @@ class FunctionalTestCaseBootstrapUtility
 
         // Drop database in case a previous test had a fatal and did not clean up properly
         $database->admin_query('DROP DATABASE IF EXISTS `' . $this->databaseName . '`');
-        $createDatabaseResult = $database->admin_query('CREATE DATABASE `' . $this->databaseName . '`');
+        $createDatabaseResult = $database->admin_query('CREATE DATABASE `' . $this->databaseName . '` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci');
         if (!$createDatabaseResult) {
             $user = $GLOBALS['TYPO3_CONF_VARS']['DB']['username'];
             $host = $GLOBALS['TYPO3_CONF_VARS']['DB']['host'];