‪TYPO3CMS  10.4
DatabaseEffectivePidTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪DatabaseEffectivePidTest extends UnitTestCase
25 {
29  protected ‪$subject;
30 
31  protected function ‪setUp(): void
32  {
33  $this->subject = new ‪DatabaseEffectivePid();
34  }
35 
40  {
41  $input = [
42  'command' => 'edit',
43  'tableName' => 'pages',
44  'databaseRow' => [
45  'uid' => 123,
46  ],
47  ];
48  $expected = $input;
49  $expected['effectivePid'] = 123;
50  self::assertSame($expected, $this->subject->addData($input));
51  }
52 
57  {
58  $input = [
59  'command' => 'edit',
60  'tableName' => 'tt_content',
61  'databaseRow' => [
62  'pid' => 123,
63  ],
64  ];
65  $expected = $input;
66  $expected['effectivePid'] = 123;
67  self::assertSame($expected, $this->subject->addData($input));
68  }
69 
74  {
75  $input = [
76  'command' => 'new',
77  'tableName' => 'tt_content',
78  'parentPageRow' => [
79  'uid' => 123
80  ],
81  ];
82  $expected = $input;
83  $expected['effectivePid'] = 123;
84  self::assertSame($expected, $this->subject->addData($input));
85  }
86 
91  {
92  $input = [
93  'command' => 'new',
94  'tableName' => 'pages',
95  'parentPageRow' => null,
96  ];
97  $expected = $input;
98  $expected['effectivePid'] = 0;
99  self::assertSame($expected, $this->subject->addData($input));
100  }
101 }
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\DatabaseEffectivePidTest\addDataSetsUidOfParentPageRowIfParentPageRowExistsAndCommandIsNew
‪addDataSetsUidOfParentPageRowIfParentPageRowExistsAndCommandIsNew()
Definition: DatabaseEffectivePidTest.php:72
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\DatabaseEffectivePidTest\addDataSetsZeroWithMissingParentPageRowAndCommandIsNew
‪addDataSetsZeroWithMissingParentPageRowAndCommandIsNew()
Definition: DatabaseEffectivePidTest.php:89
‪TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseEffectivePid
Definition: DatabaseEffectivePid.php:24
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\DatabaseEffectivePidTest\setUp
‪setUp()
Definition: DatabaseEffectivePidTest.php:30
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\DatabaseEffectivePidTest\addDataSetsPidOfRecordIfNoPageIsEdited
‪addDataSetsPidOfRecordIfNoPageIsEdited()
Definition: DatabaseEffectivePidTest.php:55
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\DatabaseEffectivePidTest\addDataSetsUidOfRecordIsPageIsEdited
‪addDataSetsUidOfRecordIsPageIsEdited()
Definition: DatabaseEffectivePidTest.php:38
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\DatabaseEffectivePidTest
Definition: DatabaseEffectivePidTest.php:25
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\DatabaseEffectivePidTest\$subject
‪DatabaseEffectivePid $subject
Definition: DatabaseEffectivePidTest.php:28
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:18