[TASK] Remove an incomplete unit test 29/48829/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 6 Jul 2016 16:04:15 +0000 (18:04 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Wed, 6 Jul 2016 16:58:15 +0000 (18:58 +0200)
The incomplete test does not make sense until further work
has been done. The commented code is removed and substituted
with a comment to explain what could be done later.

Change-Id: I2b574595f7e5f7a939b68cdf99253efe08946c52
Resolves: #76962
Releases: master
Reviewed-on: https://review.typo3.org/48829
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/backend/Classes/Form/FormDataProvider/InitializeProcessedTca.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/InitializeProcessedTcaTest.php

index 0ab77b4..2d807f4 100644 (file)
@@ -48,17 +48,11 @@ class InitializeProcessedTca implements FormDataProviderInterface
             );
         }
 
-        /**
-         * @todo: This does not work for "default" fields like "hidden", those don't have a type set - fix in bootstrap??
-        foreach ($result['processedTca']['columns'] as $fieldName => $fieldConfig) {
-            if (!isset($fieldConfig['type'])) {
-                throw new \UnexpectedValueException(
-                    'Field ' . $fieldName . ' of TCA table ' . $result['tableName'] . ' has no type set',
-                    1438594044
-                );
-            }
-        }
-         */
+        // Usually, all columns fields have a 'type'. This position would be a good place to
+        // loop and throw an exception if a type is missing. Unfortunately, type is missing
+        // for some internal fields like "hidden". So a bootstrap migration needs to be
+        // created first to enforce this rule here. Some sanitation in data providers below
+        // could be saved this way.
 
         return $result;
     }
index afa3950..cd8557c 100644 (file)
@@ -35,24 +35,6 @@ class InitializeProcessedTcaTest extends UnitTestCase
     /**
      * @test
      */
-    public function addDataThrowsExceptionIfTcaColumnsHasNoTypeSet()
-    {
-        $this->markTestIncomplete('skipped for now, this is not save');
-        $input = [
-            'processedTca' => [
-                'columns' => [
-                    'aField' => [],
-                ],
-            ],
-        ];
-        $this->expectException(\UnexpectedValueException::class);
-        $this->expectExceptionCode(1438594044);
-        $this->subject->addData($input);
-    }
-
-    /**
-     * @test
-     */
     public function addDataSetsTableTcaFromGlobalsInResult()
     {
         $input = [