2 namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider;
17 use TYPO3\CMS\Core\Tests\UnitTestCase;
42 'tableName' =>
'aTable',
55 $this->assertSame($input, $this->subject->addData($input));
65 'databaseRow' =>
'not-an-array',
67 $this->setExpectedException(\UnexpectedValueException::class, $this->anything(), 1444431128);
68 $this->subject->addData($input);
78 'tableName' =>
'aTable',
85 $expected[
'databaseRow'][
'pid'] = 23;
86 $this->assertSame($expected, $this->subject->addData($input));
96 'tableName' =>
'aTable',
102 'aField' =>
'userTsValue',
113 'aField' =>
'userTsValue',
116 $result = $this->subject->addData($input);
117 $this->assertSame($expected, $result[
'databaseRow']);
127 'tableName' =>
'aTable',
133 'aField' =>
'userTsValue',
144 $result = $this->subject->addData($input);
145 $this->assertSame($expected, $result[
'databaseRow']);
155 'tableName' =>
'aTable',
161 'aField' =>
'pageTsValue',
172 'aField' =>
'pageTsValue',
175 $result = $this->subject->addData($input);
176 $this->assertSame($expected, $result[
'databaseRow']);
186 'tableName' =>
'aTable',
192 'aField' =>
'pageTsValue',
203 $result = $this->subject->addData($input);
204 $this->assertSame($expected, $result[
'databaseRow']);
214 'tableName' =>
'aTable',
220 'aField' =>
'pageTsValue',
227 'aField' =>
'userTsValue',
238 'aField' =>
'pageTsValue',
241 $result = $this->subject->addData($input);
242 $this->assertSame($expected, $result[
'databaseRow']);
252 'tableName' =>
'aTable',
256 'aField' =>
'valueFromNeighbor',
260 'useColumnsForDefaultValues' =>
'aField',
268 'aField' =>
'valueFromNeighbor',
271 $result = $this->subject->addData($input);
272 $this->assertSame($expected, $result[
'databaseRow']);
282 'tableName' =>
'aTable',
286 'aField' =>
'valueFromNeighbor',
291 'aField' =>
'pageTsValue',
298 'aField' =>
'userTsValue',
304 'useColumnsForDefaultValues' =>
'aField',
312 'aField' =>
'valueFromNeighbor',
315 $result = $this->subject->addData($input);
316 $this->assertSame($expected, $result[
'databaseRow']);
326 'tableName' =>
'aTable',
338 'aField' =>
'getValue',
343 'aField' =>
'getValue',
346 $result = $this->subject->addData($input);
347 $this->assertSame($expected, $result[
'databaseRow']);
357 'tableName' =>
'aTable',
369 'aField' =>
'postValue',
374 'aField' =>
'postValue',
377 $result = $this->subject->addData($input);
378 $this->assertSame($expected, $result[
'databaseRow']);
388 'tableName' =>
'aTable',
400 'aField' =>
'getValue',
407 'aField' =>
'postValue',
412 'aField' =>
'postValue',
415 $result = $this->subject->addData($input);
416 $this->assertSame($expected, $result[
'databaseRow']);
426 'tableName' =>
'aTable',
432 'aField' =>
'pageTsValue',
443 'aField' =>
'getValue',
450 'aField' =>
'postValue',
457 $result = $this->subject->addData($input);
458 $this->assertSame($expected, $result[
'databaseRow']);
468 'tableName' =>
'aTable',
472 'aField' =>
'valueFromNeighbor',
477 'aField' =>
'pageTsValue',
484 'aField' =>
'userTsValue',
490 'useColumnsForDefaultValues' =>
'aField',
500 'aField' =>
'postValue',
505 'aField' =>
'postValue',
508 $result = $this->subject->addData($input);
509 $this->assertSame($expected, $result[
'databaseRow']);
520 'inlineChildChildUid' => 42,
522 $this->setExpectedException(\UnexpectedValueException::class, $this->anything(), 1444434102);
523 $this->subject->addData($input);
534 'inlineChildChildUid' =>
'42',
536 $this->setExpectedException(\UnexpectedValueException::class, $this->anything(), 1444434103);
537 $this->subject->addData($input);
547 'tableName' =>
'aTable',
549 'inlineChildChildUid' => 42,
550 'inlineParentConfig' => [
551 'foreign_selector' =>
'theForeignSelectorField',
555 'theForeignSelectorField' => [
564 $expected[
'databaseRow'][
'theForeignSelectorField'] = 42;
565 $expected[
'databaseRow'][
'pid'] = null;
566 $this->assertSame($expected, $this->subject->addData($input));
576 'tableName' =>
'aTable',
578 'inlineChildChildUid' => 42,
579 'inlineParentConfig' => [
580 'foreign_selector' =>
'theForeignSelectorField',
584 'theForeignSelectorField' => [
592 $this->setExpectedException(\UnexpectedValueException::class, $this->anything(), 1444434104);
593 $this->subject->addData($input);
603 'tableName' =>
'aTable',
607 $expected[
'pid'] = 23;
608 $result = $this->subject->addData($input);
609 $this->assertSame($expected, $result[
'databaseRow']);