[BUGFIX] Ensure proper quoting of fields for PostgreSQL in JsonRenderer.ts
[Packages/TYPO3.CMS.git] / components / testing_framework / Classes / Core / Functional / FunctionalTestCase.php
index 8bcf126..acee9b1 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\Components\TestingFramework\Core;
+namespace TYPO3\Components\TestingFramework\Core\Functional;
 
 /*
  * This file is part of the TYPO3 CMS project.
@@ -14,12 +14,14 @@ namespace TYPO3\Components\TestingFramework\Core;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\Components\TestingFramework\Core\Functional\Framework\Frontend\Response;
+use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Cache\Backend\NullBackend;
-use TYPO3\CMS\Core\Core\Bootstrap;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\Components\TestingFramework\Core\BaseTestCase;
+use TYPO3\Components\TestingFramework\Core\Functional\Framework\Frontend\Response;
+use TYPO3\Components\TestingFramework\Core\Testbase;
 
 /**
  * Base test case class for functional tests, all TYPO3 CMS
@@ -348,6 +350,11 @@ abstract class FunctionalTestCase extends BaseTestCase
             $this->fail('Cannot set up frontend root page "' . $pageId . '"');
         }
 
+        $databasePlatform = 'mysql';
+        if ($connection->getDatabasePlatform() instanceof PostgreSqlPlatform) {
+            $databasePlatform = 'postgresql';
+        }
+
         $connection->update(
             'pages',
             ['is_siteroot' => 1],
@@ -357,6 +364,7 @@ abstract class FunctionalTestCase extends BaseTestCase
         $templateFields = [
             'pid' => $pageId,
             'title' => '',
+            'constants' => 'databasePlatform = ' . $databasePlatform . LF,
             'config' => '',
             'clear' => 3,
             'root' => 1,