[BUGFIX] Show correct label for IRRE records
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Tests / Unit / Form / FormDataProvider / DatabaseEffectivePidTest.php
index 27bac04..dfa4f7e 100644 (file)
@@ -14,83 +14,87 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Tests\UnitTestCase;
 use TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseEffectivePid;
+use TYPO3\CMS\Core\Tests\UnitTestCase;
 
 /**
  * Test case
  */
-class DatabaseEffectivePidTest extends UnitTestCase {
-
-       /**
-        * @var DatabaseEffectivePid
-        */
-       protected $subject;
-
-       protected function setUp() {
-               $this->subject = new DatabaseEffectivePid();
-       }
+class DatabaseEffectivePidTest extends UnitTestCase
+{
+    /**
+     * @var DatabaseEffectivePid
+     */
+    protected $subject;
 
-       /**
-        * @test
-        */
-       public function addDataSetsUidOfRecordIsPageIsEdited() {
-               $input = [
-                       'command' => 'edit',
-                       'tableName' => 'pages',
-                       'databaseRow' => [
-                               'uid' => 123,
-                       ],
-               ];
-               $expected = $input;
-               $expected['effectivePid'] = 123;
-               $this->assertSame($expected, $this->subject->addData($input));
-       }
+    protected function setUp()
+    {
+        $this->subject = new DatabaseEffectivePid();
+    }
 
-       /**
-        * @test
-        */
-       public function addDataSetsPidOfRecordIfNoPageIsEdited() {
-               $input = [
-                       'command' => 'edit',
-                       'tableName' => 'tt_content',
-                       'databaseRow' => [
-                               'pid' => 123,
-                       ],
-               ];
-               $expected = $input;
-               $expected['effectivePid'] = 123;
-               $this->assertSame($expected, $this->subject->addData($input));
-       }
+    /**
+     * @test
+     */
+    public function addDataSetsUidOfRecordIsPageIsEdited()
+    {
+        $input = [
+            'command' => 'edit',
+            'tableName' => 'pages',
+            'databaseRow' => [
+                'uid' => 123,
+            ],
+        ];
+        $expected = $input;
+        $expected['effectivePid'] = 123;
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
 
-       /**
-        * @test
-        */
-       public function addDataSetsUidOfParentPageRowIfParentPageRowExistsAndCommandIsNew() {
-               $input = [
-                       'command' => 'new',
-                       'tableName' => 'tt_content',
-                       'parentPageRow' => [
-                               'uid' => 123
-                       ],
-               ];
-               $expected = $input;
-               $expected['effectivePid'] = 123;
-               $this->assertSame($expected, $this->subject->addData($input));
-       }
+    /**
+     * @test
+     */
+    public function addDataSetsPidOfRecordIfNoPageIsEdited()
+    {
+        $input = [
+            'command' => 'edit',
+            'tableName' => 'tt_content',
+            'databaseRow' => [
+                'pid' => 123,
+            ],
+        ];
+        $expected = $input;
+        $expected['effectivePid'] = 123;
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
 
-       /**
-        * @test
-        */
-       public function addDataSetsZeroWithMissingParentPageRowAndCommandIsNew() {
-               $input = [
-                       'command' => 'new',
-                       'tableName' => 'pages',
-                       'parentPageRow' => NULL,
-               ];
-               $expected = $input;
-               $expected['effectivePid'] = 0;
-               $this->assertSame($expected, $this->subject->addData($input));
-       }
+    /**
+     * @test
+     */
+    public function addDataSetsUidOfParentPageRowIfParentPageRowExistsAndCommandIsNew()
+    {
+        $input = [
+            'command' => 'new',
+            'tableName' => 'tt_content',
+            'parentPageRow' => [
+                'uid' => 123
+            ],
+        ];
+        $expected = $input;
+        $expected['effectivePid'] = 123;
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
 
+    /**
+     * @test
+     */
+    public function addDataSetsZeroWithMissingParentPageRowAndCommandIsNew()
+    {
+        $input = [
+            'command' => 'new',
+            'tableName' => 'pages',
+            'parentPageRow' => null,
+        ];
+        $expected = $input;
+        $expected['effectivePid'] = 0;
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
 }