[BUGFIX] Show record title for inline element
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Tests / Unit / Form / FormDataProvider / TcaRecordTitleTest.php
index 4a04aca..5db0abf 100644 (file)
@@ -617,6 +617,42 @@ class TcaRecordTitleTest extends UnitTestCase
     }
 
     /**
+     * @test
+     */
+    public function addDataReturnsRecordTitleForInlineType()
+    {
+        $input = [
+            'tableName' => 'aTable',
+            'databaseRow' => [
+                'uid' => '1',
+                'aField' => '2',
+            ],
+            'processedTca' => [
+                'ctrl' => [
+                    'label' => 'aField'
+                ],
+                'columns' => [
+                    'aField' => [
+                        'config' => [
+                            'type' => 'inline'
+                        ],
+                        'children' => [
+                            [
+                                'recordTitle' => 'foo',
+                                'vanillaUid' => 2
+                            ]
+                        ]
+                    ]
+                ],
+            ]
+        ];
+
+        $expected = $input;
+        $expected['recordTitle'] = 'foo';
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
+    /**
      * Data provider for addDataReturnsRecordTitleForGroupType
      * Each data set is an array with the following elements:
      *  - TCA field configuration (merged with base config)