‪TYPO3CMS  ‪main
TcaInlineIsOnSymmetricSideTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use PHPUnit\Framework\Attributes\Test;
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
23 
24 final class ‪TcaInlineIsOnSymmetricSideTest extends UnitTestCase
25 {
27 
31  public function ‪setUp(): void
32  {
33  parent::setUp();
34  $this->subject = new ‪TcaInlineIsOnSymmetricSide();
35  }
36 
37  #[Test]
38  public function ‪addDataSetsIsOnSymmetricSideToTrue(): void
39  {
40  $input = [
41  'databaseRow' => [
42  'uid' => 5,
43  'theSymmetricField' => [
44  23,
45  ],
46  ],
47  'isInlineChild' => true,
48  'inlineParentUid' => 23,
49  'inlineParentConfig' => [
50  'symmetric_field' => 'theSymmetricField',
51  ],
52  ];
53  $expected = $input;
54  $expected['isOnSymmetricSide'] = true;
55  self::assertEquals($expected, $this->subject->addData($input));
56  }
57 
58  #[Test]
60  {
61  $input = [
62  'databaseRow' => [
63  'uid' => 5,
64  'theSymmetricField' => [
65  [
66  'table' => 'theSymmetricTable',
67  'uid' => 23,
68  'title' => 'The title',
69  'row' => [
70  'uid' => 23,
71  ],
72  ],
73  ],
74  ],
75  'isInlineChild' => true,
76  'inlineParentUid' => 23,
77  'inlineParentConfig' => [
78  'symmetric_field' => 'theSymmetricField',
79  ],
80  ];
81  $expected = $input;
82  $expected['isOnSymmetricSide'] = true;
83  self::assertEquals($expected, $this->subject->addData($input));
84  }
85 }
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaInlineIsOnSymmetricSideTest\setUp
‪setUp()
Definition: TcaInlineIsOnSymmetricSideTest.php:31
‪TYPO3\CMS\Backend\Form\FormDataProvider\TcaInlineIsOnSymmetricSide
Definition: TcaInlineIsOnSymmetricSide.php:28
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaInlineIsOnSymmetricSideTest
Definition: TcaInlineIsOnSymmetricSideTest.php:25
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaInlineIsOnSymmetricSideTest\$subject
‪TcaInlineIsOnSymmetricSide $subject
Definition: TcaInlineIsOnSymmetricSideTest.php:26
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaInlineIsOnSymmetricSideTest\addDataSetsIsOnSymmetricSideToTrueWhenSymmetricFieldArrayIsDetailed
‪addDataSetsIsOnSymmetricSideToTrueWhenSymmetricFieldArrayIsDetailed()
Definition: TcaInlineIsOnSymmetricSideTest.php:59
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaInlineIsOnSymmetricSideTest\addDataSetsIsOnSymmetricSideToTrue
‪addDataSetsIsOnSymmetricSideToTrue()
Definition: TcaInlineIsOnSymmetricSideTest.php:38
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:18