[BUGFIX] Update installation acceptance tests 59/58559/6
authorMathias Brodala <mbrodala@pagemachine.de>
Tue, 2 Oct 2018 13:28:18 +0000 (15:28 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 3 Oct 2018 06:16:31 +0000 (08:16 +0200)
The introduction package was revamped which brought us some text
changes, thus update the installation acceptance tests accordingly.

To mitigate an issue with certain databases causing a wrong casing of
column names, the DefaultTcaSchema now always quotes all column names
with backticks.

Resolves: #86544
Releases: master
Change-Id: Ic91368817bb775379302e904496c35537aaaa13c
Reviewed-on: https://review.typo3.org/58559
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stephan Großberndt <stephan.grossberndt@typo3.org>
Reviewed-by: Jörg Bösche <typo3@joergboesche.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/Database/Schema/DefaultTcaSchema.php
typo3/sysext/core/Tests/Acceptance/Install/Mysql/IntroductionPackageCest.php
typo3/sysext/core/Tests/Acceptance/Install/Postgresql/IntroductionPackageCest.php
typo3/sysext/core/Tests/Acceptance/Install/Sqlite/IntroductionPackageCest.php
typo3/sysext/core/Tests/Unit/Database/Schema/DefaultTcaSchemaTest.php

index a3e523f..6a0f976 100644 (file)
@@ -100,7 +100,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['tstamp'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['tstamp'],
+                    $this->quote($tableDefinition['ctrl']['tstamp']),
                     'integer',
                     [
                         'default' => 0,
@@ -115,7 +115,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['crdate'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['crdate'],
+                    $this->quote($tableDefinition['ctrl']['crdate']),
                     'integer',
                     [
                         'default' => 0,
@@ -130,7 +130,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['cruser_id'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['cruser_id'],
+                    $this->quote($tableDefinition['ctrl']['cruser_id']),
                     'integer',
                     [
                         'default' => 0,
@@ -145,7 +145,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['delete'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['delete'],
+                    $this->quote($tableDefinition['ctrl']['delete']),
                     'smallint',
                     [
                         'default' => 0,
@@ -160,7 +160,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['enablecolumns']['disabled'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['enablecolumns']['disabled'],
+                    $this->quote($tableDefinition['ctrl']['enablecolumns']['disabled']),
                     'smallint',
                     [
                         'default' => 0,
@@ -175,7 +175,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['enablecolumns']['starttime'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['enablecolumns']['starttime'],
+                    $this->quote($tableDefinition['ctrl']['enablecolumns']['starttime']),
                     'integer',
                     [
                         'default' => 0,
@@ -190,7 +190,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['enablecolumns']['endtime'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['enablecolumns']['endtime'],
+                    $this->quote($tableDefinition['ctrl']['enablecolumns']['endtime']),
                     'integer',
                     [
                         'default' => 0,
@@ -205,7 +205,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['enablecolumns']['fe_group'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['enablecolumns']['fe_group'],
+                    $this->quote($tableDefinition['ctrl']['enablecolumns']['fe_group']),
                     'string',
                     [
                         'default' => '0',
@@ -220,7 +220,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['sortby'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['sortby'],
+                    $this->quote($tableDefinition['ctrl']['sortby']),
                     'integer',
                     [
                         'default' => 0,
@@ -247,7 +247,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['descriptionColumn'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['descriptionColumn'],
+                    $this->quote($tableDefinition['ctrl']['descriptionColumn']),
                     'text',
                     [
                         'notnull' => false,
@@ -261,7 +261,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['editlock'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['editlock'],
+                    $this->quote($tableDefinition['ctrl']['editlock']),
                     'smallint',
                     [
                         'default' => 0,
@@ -276,7 +276,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['languageField'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    (string)$tableDefinition['ctrl']['languageField'],
+                    $this->quote((string)$tableDefinition['ctrl']['languageField']),
                     'integer',
                     [
                         'default' => 0,
@@ -292,7 +292,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['transOrigPointerField'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    (string)$tableDefinition['ctrl']['transOrigPointerField'],
+                    $this->quote((string)$tableDefinition['ctrl']['transOrigPointerField']),
                     'integer',
                     [
                         'default' => 0,
@@ -308,7 +308,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['translationSource'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    (string)$tableDefinition['ctrl']['translationSource'],
+                    $this->quote((string)$tableDefinition['ctrl']['translationSource']),
                     'integer',
                     [
                         'default' => 0,
@@ -324,7 +324,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, 'l10n_state')
             ) {
                 $tables[$tablePosition]->addColumn(
-                    'l10n_state',
+                    $this->quote('l10n_state'),
                     'text',
                     [
                         'notnull' => false,
@@ -338,7 +338,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['origUid'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['origUid'],
+                    $this->quote($tableDefinition['ctrl']['origUid']),
                     'integer',
                     [
                         'default' => 0,
@@ -353,7 +353,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, $tableDefinition['ctrl']['transOrigDiffSourceField'])
             ) {
                 $tables[$tablePosition]->addColumn(
-                    $tableDefinition['ctrl']['transOrigDiffSourceField'],
+                    $this->quote($tableDefinition['ctrl']['transOrigDiffSourceField']),
                     'blob',
                     [
                         // mediumblob (16MB) on mysql
@@ -369,7 +369,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, 't3ver_oid')
             ) {
                 $tables[$tablePosition]->addColumn(
-                    't3ver_oid',
+                    $this->quote('t3ver_oid'),
                     'integer',
                     [
                         'default' => 0,
@@ -385,7 +385,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, 't3ver_id')
             ) {
                 $tables[$tablePosition]->addColumn(
-                    't3ver_id',
+                    $this->quote('t3ver_id'),
                     'integer',
                     [
                         'default' => 0,
@@ -401,7 +401,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, 't3ver_label')
             ) {
                 $tables[$tablePosition]->addColumn(
-                    't3ver_label',
+                    $this->quote('t3ver_label'),
                     'string',
                     [
                         'default' => '',
@@ -417,7 +417,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, 't3ver_wsid')
             ) {
                 $tables[$tablePosition]->addColumn(
-                    't3ver_wsid',
+                    $this->quote('t3ver_wsid'),
                     'integer',
                     [
                         'default' => 0,
@@ -433,7 +433,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, 't3ver_state')
             ) {
                 $tables[$tablePosition]->addColumn(
-                    't3ver_state',
+                    $this->quote('t3ver_state'),
                     'smallint',
                     [
                         'default' => 0,
@@ -449,7 +449,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, 't3ver_stage')
             ) {
                 $tables[$tablePosition]->addColumn(
-                    't3ver_stage',
+                    $this->quote('t3ver_stage'),
                     'integer',
                     [
                         'default' => 0,
@@ -465,7 +465,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, 't3ver_count')
             ) {
                 $tables[$tablePosition]->addColumn(
-                    't3ver_count',
+                    $this->quote('t3ver_count'),
                     'integer',
                     [
                         'default' => 0,
@@ -481,7 +481,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, 't3ver_tstamp')
             ) {
                 $tables[$tablePosition]->addColumn(
-                    't3ver_tstamp',
+                    $this->quote('t3ver_tstamp'),
                     'integer',
                     [
                         'default' => 0,
@@ -497,7 +497,7 @@ class DefaultTcaSchema
                 && !$this->isColumnDefinedForTable($tables, $tableName, 't3ver_move_id')
             ) {
                 $tables[$tablePosition]->addColumn(
-                    't3ver_move_id',
+                    $this->quote('t3ver_move_id'),
                     'integer',
                     [
                         'default' => 0,
@@ -692,4 +692,13 @@ class DefaultTcaSchema
         }
         throw new \RuntimeException('Table ' . $tableName . ' not found in schema list', 1527854474);
     }
+
+    /**
+     * @param string $identifier
+     * @return string
+     */
+    protected function quote(string $identifier): string
+    {
+        return '`' . $identifier . '`';
+    }
 }
index d02f216..9d58de5 100644 (file)
@@ -80,11 +80,11 @@ class IntroductionPackageCest
 
         // Verify default frontend is rendered
         $I->amOnPage('/');
-        $I->waitForText('Let us introduce you to TYPO3', 30);
-        $I->waitForText('Make it your own');
+        $I->waitForText('Deliver business value', 30);
+        $I->waitForText('100% free open source software');
 
         // Verify link
         $I->click('[title="Features"]');
-        $I->waitForText('Feature Complete Out-of-the-box', 30);
+        $I->waitForText('rich core feature set out-of-the-box', 30);
     }
 }
index 5a936ba..712a41c 100644 (file)
@@ -77,11 +77,11 @@ class IntroductionPackageCest
 
         // Verify default frontend is rendered
         $I->amOnPage('/');
-        $I->waitForText('Let us introduce you to TYPO3', 30);
-        $I->waitForText('Make it your own');
+        $I->waitForText('Deliver business value', 30);
+        $I->waitForText('100% free open source software');
 
         // Verify link
         $I->click('[title="Features"]');
-        $I->waitForText('Feature Complete Out-of-the-box', 30);
+        $I->waitForText('rich core feature set out-of-the-box', 30);
     }
 }
index 71841b9..3417f82 100644 (file)
@@ -71,11 +71,11 @@ class IntroductionPackageCest
 
         // Verify default frontend is rendered
         $I->amOnPage('/');
-        $I->waitForText('Let us introduce you to TYPO3', 30);
-        $I->waitForText('Make it your own');
+        $I->waitForText('Deliver business value', 30);
+        $I->waitForText('100% free open source software');
 
         // Verify link
         $I->click('[title="Features"]');
-        $I->waitForText('Feature Complete Out-of-the-box', 30);
+        $I->waitForText('rich core feature set out-of-the-box', 30);
     }
 }
index e76bac7..9e3770b 100644 (file)
@@ -174,7 +174,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'updatedon',
+            '`updatedon`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -195,7 +195,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'createdon',
+            '`createdon`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -216,7 +216,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'createdby',
+            '`createdby`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -237,7 +237,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'deleted',
+            '`deleted`',
             Type::getType('smallint'),
             [
                 'default' => 0,
@@ -260,7 +260,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'disabled',
+            '`disabled`',
             Type::getType('smallint'),
             [
                 'default' => 0,
@@ -283,7 +283,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'starttime',
+            '`starttime`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -306,7 +306,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'endtime',
+            '`endtime`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -329,7 +329,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'fe_group',
+            '`fe_group`',
             Type::getType('string'),
             [
                 'default' => '0',
@@ -350,7 +350,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'sorting',
+            '`sorting`',
             Type::getType('integer'),
             [
                 'default' => '0',
@@ -426,7 +426,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'sys_language_uid',
+            '`sys_language_uid`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -448,7 +448,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'l10n_parent',
+            '`l10n_parent`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -478,18 +478,18 @@ class DefaultTcaSchemaTest extends UnitTestCase
     public function enrichAddsDescription()
     {
         $GLOBALS['TCA']['aTable']['ctrl'] = [
-            'descriptionColumn' => 'description',
+            'descriptionColumn' => 'rowDescription',
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'description',
+            '`rowDescription`',
             Type::getType('text'),
             [
                 'notnull' => false,
                 'length' => 65535,
             ]
         );
-        $this->assertEquals($expectedColumn, $result[0]->getColumn('description'));
+        $this->assertEquals($expectedColumn, $result[0]->getColumn('rowDescription'));
     }
 
     /**
@@ -502,7 +502,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'editlock',
+            '`editlock`',
             Type::getType('smallint'),
             [
                 'default' => 0,
@@ -524,7 +524,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'l10n_source',
+            '`l10n_source`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -559,7 +559,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'l10n_state',
+            '`l10n_state`',
             Type::getType('text'),
             [
                 'notnull' => false,
@@ -605,7 +605,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            't3_origuid',
+            '`t3_origuid`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -626,7 +626,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            'l18n_diffsource',
+            '`l18n_diffsource`',
             Type::getType('blob'),
             [
                 'length' => 16777215,
@@ -646,7 +646,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            't3ver_oid',
+            '`t3ver_oid`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -667,7 +667,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            't3ver_id',
+            '`t3ver_id`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -688,7 +688,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            't3ver_label',
+            '`t3ver_label`',
             Type::getType('string'),
             [
                 'default' => '',
@@ -709,7 +709,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            't3ver_wsid',
+            '`t3ver_wsid`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -730,7 +730,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            't3ver_state',
+            '`t3ver_state`',
             Type::getType('smallint'),
             [
                 'default' => 0,
@@ -751,7 +751,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            't3ver_stage',
+            '`t3ver_stage`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -772,7 +772,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            't3ver_count',
+            '`t3ver_count`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -793,7 +793,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            't3ver_tstamp',
+            '`t3ver_tstamp`',
             Type::getType('integer'),
             [
                 'default' => 0,
@@ -814,7 +814,7 @@ class DefaultTcaSchemaTest extends UnitTestCase
         ];
         $result = (new DefaultTcaSchema())->enrich([]);
         $expectedColumn = new Column(
-            't3ver_move_id',
+            '`t3ver_move_id`',
             Type::getType('integer'),
             [
                 'default' => 0,