[TASK] Streamline functional data handling tests 33/57133/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 6 Jun 2018 20:06:24 +0000 (22:06 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 6 Jun 2018 22:13:20 +0000 (00:13 +0200)
The various "AbstractActionTestCase" classes of the functional
data handling tests only prepare the scenario, while the extending
Test classes of ext:core and ext:workspaces then call parent and
add assertions.
The abstract test preparations thus must not have @test annotations,
they would be executed as casual tests without asserting anything
useful.
The patch removes those obsolete @test annotations and fixes
another test case that had wrong wrong naming and was not executed
for a while.

Resolves: #85170
Releases: master
Change-Id: Ibf6f9ef99f7eaeaeba1374962112d4a342c36567
Reviewed-on: https://review.typo3.org/57133
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/ActionTest.php [new file with mode: 0644]
typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/ActionTestCase.php [deleted file]
typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/DataSet/LiveDefaultElements.csv
typo3/sysext/core/Tests/Functional/DataHandling/Group/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/Select/AbstractActionTestCase.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php

diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/ActionTest.php
new file mode 100644 (file)
index 0000000..6fd1d34
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase;
+
+class ActionTest extends AbstractDataHandlerActionTestCase
+{
+    protected $coreExtensionsToLoad = [
+        'workspaces',
+    ];
+
+    /**
+     * @var array
+     */
+    protected $pathsToLinkInTestInstance = [
+        'typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/Fixtures/fileadmin' => 'fileadmin/fixture',
+    ];
+
+    /**
+     * @var string
+     */
+    protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/DataSet/';
+
+    /**
+     * @test
+     */
+    public function newVersionOfFileRelationInFlexformFieldIsCreatedOnSave()
+    {
+        $this->importScenarioDataSet('LiveDefaultPages');
+        $this->importScenarioDataSet('LiveDefaultElements');
+        $this->backendUser->workspace = 1;
+        $GLOBALS['BE_USER']->workspace = 1;
+        $this->getActionService()->modifyRecords(1, [
+            //'sys_file_reference' => ['uid' => 10, 'hidden' => 0],
+            'tt_content' => ['uid' => 100, 'header' => 'Content #1 (WS)']
+        ]);
+
+        // there should be one relation in the live WS and one in the draft WS pointing to the file field.
+        $queryBuilder = $this->getConnectionPool()
+            ->getQueryBuilderForTable('sys_file_reference');
+        $queryBuilder->getRestrictions()->removeAll();
+        $referenceCount = $queryBuilder
+            ->count('uid')
+            ->from('sys_file_reference')
+            ->where($queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter(20, \PDO::PARAM_INT)))
+            ->execute()
+            ->fetchColumn(0);
+
+        $this->assertEquals(2, $referenceCount);
+    }
+}
diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/ActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/ActionTestCase.php
deleted file mode 100644 (file)
index 29bf6c8..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-namespace TYPO3\CMS\Core\Tests\Functional\DataHandling\FlexformIrre;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-class ActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
-{
-    /**
-     * @var array
-     */
-    protected $pathsToLinkInTestInstance = [
-        'typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/Fixtures/fileadmin' => 'fileadmin/fixture',
-    ];
-
-    /**
-     * @var string
-     */
-    protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/FlexformIrre/DataSet/';
-
-    protected function setUp()
-    {
-        $this->testExtensionsToLoad[] = 'typo3/sysext/version/';
-        $this->testExtensionsToLoad[] = 'typo3/sysext/workspaces/';
-
-        parent::setUp();
-        $this->importScenarioDataSet('LiveDefaultPages');
-        $this->importScenarioDataSet('LiveDefaultElements');
-    }
-
-    /**
-     * @test
-     */
-    public function newVersionOfFileRelationInFlexformFieldIsCreatedOnSave()
-    {
-        $this->backendUser->workspace = 1;
-        $GLOBALS['BE_USER']->workspace = 1;
-        $this->getActionService()->modifyRecords(1, [
-            //'sys_file_reference' => ['uid' => 10, 'hidden' => 0],
-            'tt_content' => ['uid' => 100, 'header' => 'Content #1 (WS)']
-        ]);
-
-        // there should be one relation in the live WS and one in the draft WS pointing to the file field.
-        $queryBuilder = $this->getConnectionPool()
-            ->getQueryBuilderForTable('sys_file_reference');
-        $queryBuilder->getRestrictions()->removeAll();
-        $referenceCount = $queryBuilder
-            ->count('uid')
-            ->from('sys_file_reference')
-            ->where($queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter(20, \PDO::PARAM_INT)))
-            ->execute()
-            ->fetchColumn(0);
-
-        $this->assertEquals(2, $referenceCount);
-    }
-}
index a00ab54..e8687f5 100644 (file)
@@ -12,5 +12,5 @@
 ,"uid","pid","storage","identifier","name",,,,,,,,,,
 ,20,0,1,"/typo3-logo.png","typo3-logo.png",,,,,,,,,,
 "sys_file_reference",,,,,,,,,,,,,,,
-,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","sorting","sorting_foreign","table_local","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id"
-,1,1,20,100,"tt_content","files",1,1,"sys_file",0,0,0,0,0,0
+,"uid","pid","uid_local","uid_foreign","tablenames","fieldname","sorting_foreign","table_local","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id",
+,1,1,20,100,"tt_content","files",1,"sys_file",0,0,0,0,0,0,
index 4ac52e0..2ce08ce 100644 (file)
@@ -56,7 +56,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
      */
 
     /**
-     * @test
      * @see DataSet/addElementRelation.csv
      */
     public function addElementRelation()
@@ -70,7 +69,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/deleteElementRelation.csv
      */
     public function deleteElementRelation()
@@ -84,7 +82,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/changeElementSorting.csv
      */
     public function changeElementSorting()
@@ -93,7 +90,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/changeElementRelationSorting.csv
      */
     public function changeElementRelationSorting()
@@ -107,7 +103,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/createContentNAddRelation.csv
      */
     public function createContentAndAddElementRelation()
@@ -121,7 +116,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/createContentNCreateRelation.csv
      */
     public function createContentAndCreateElementRelation()
@@ -134,7 +128,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/modifyElementOfRelation.csv
      */
     public function modifyElementOfRelation()
@@ -143,7 +136,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/modifyContentOfRelation.csv
      */
     public function modifyContentOfRelation()
@@ -152,7 +144,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/modifyBothSidesOfRelation.csv
      */
     public function modifyBothSidesOfRelation()
@@ -162,7 +153,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/deleteContentOfRelation.csv
      */
     public function deleteContentOfRelation()
@@ -171,7 +161,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/deleteElementOfRelation.csv
      */
     public function deleteElementOfRelation()
@@ -180,7 +169,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyContentOfRelation.csv
      */
     public function copyContentOfRelation()
@@ -190,7 +178,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyElementOfRelation.csv
      */
     public function copyElementOfRelation()
@@ -200,7 +187,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyContentToLanguageOfRelation.csv
      */
     public function copyContentToLanguageOfRelation()
@@ -210,7 +196,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyElementToLanguageOfRelation.csv
      */
     public function copyElementToLanguageOfRelation()
@@ -220,7 +205,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/localizeContentOfRelation.csv
      */
     public function localizeContentOfRelation()
@@ -263,7 +247,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/localizeElementOfRelation.csv
      */
     public function localizeElementOfRelation()
@@ -273,7 +256,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/moveContentOfRelationToDifferentPage.csv
      */
     public function moveContentOfRelationToDifferentPage()
index e6c243f..524fd88 100644 (file)
@@ -57,7 +57,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
      */
 
     /**
-     * @test
      * @see DataSet/addCategoryRelation.csv
      */
     public function addCategoryRelation()
@@ -71,7 +70,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/deleteCategoryRelation.csv
      */
     public function deleteCategoryRelation()
@@ -85,7 +83,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/changeCategoryRelationSorting.csv
      */
     public function changeCategoryRelationSorting()
@@ -99,7 +96,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/modifyCategoryRecordOfCategoryRelation.csv
      */
     public function modifyCategoryOfRelation()
@@ -108,7 +104,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/modifyContentRecordOfCategoryRelation.csv
      */
     public function modifyContentOfRelation()
@@ -117,7 +112,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/modifyBothRecordsOfCategoryRelation.csv
      */
     public function modifyBothsOfRelation()
@@ -127,7 +121,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/deleteContentRecordOfCategoryRelation.csv
      */
     public function deleteContentOfRelation()
@@ -136,7 +129,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/deleteCategoryRecordOfCategoryRelation.csv
      */
     public function deleteCategoryOfRelation()
@@ -145,7 +137,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyContentRecordOfCategoryRelation.csv
      */
     public function copyContentOfRelation()
@@ -155,7 +146,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyCategoryRecordOfCategoryRelation.csv
      */
     public function copyCategoryOfRelation()
@@ -165,7 +155,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyContentToLanguageOfRelation.csv
      */
     public function copyContentToLanguageOfRelation()
@@ -174,7 +163,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyCategoryToLanguageOfRelation.csv
      */
     public function copyCategoryToLanguageOfRelation()
@@ -183,7 +171,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/localizeContentRecordOfCategoryRelation.csv
      */
     public function localizeContentOfRelation()
@@ -229,7 +216,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/localizeCategoryRecordOfCategoryRelation.csv
      */
     public function localizeCategoryOfRelation()
@@ -239,7 +225,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/moveContentRecordOfCategoryRelationToDifferentPage.csv
      */
     public function moveContentOfRelationToDifferentPage()
@@ -248,7 +233,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyPage.csv
      */
     public function copyPage()
index 033f058..6eae4b4 100644 (file)
@@ -55,7 +55,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
      */
 
     /**
-     * @test
      * @see DataSet/addElementRelation.csv
      */
     public function addElementRelation()
@@ -69,7 +68,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/deleteElementRelation.csv
      */
     public function deleteElementRelation()
@@ -83,7 +81,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/changeElementSorting.csv
      */
     public function changeElementSorting()
@@ -92,7 +89,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/changeElementRelationSorting.csv
      */
     public function changeElementRelationSorting()
@@ -106,7 +102,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/createContentNAddRelation.csv
      */
     public function createContentAndAddElementRelation()
@@ -120,7 +115,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/createContentNCreateRelation.csv
      */
     public function createContentAndCreateElementRelation()
@@ -133,7 +127,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/modifyElementOfRelation.csv
      */
     public function modifyElementOfRelation()
@@ -142,7 +135,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/modifyContentOfRelation.csv
      */
     public function modifyContentOfRelation()
@@ -151,7 +143,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/modifyBothSidesOfRelation.csv
      */
     public function modifyBothSidesOfRelation()
@@ -161,7 +152,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/deleteContentOfRelation.csv
      */
     public function deleteContentOfRelation()
@@ -170,7 +160,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/deleteElementOfRelation.csv
      */
     public function deleteElementOfRelation()
@@ -179,7 +168,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyContentOfRelation.csv
      */
     public function copyContentOfRelation()
@@ -189,7 +177,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyElementOfRelation.csv
      */
     public function copyElementOfRelation()
@@ -199,7 +186,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyContentToLanguageOfRelation.csv
      */
     public function copyContentToLanguageOfRelation()
@@ -209,7 +195,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/copyElementToLanguageOfRelation.csv
      */
     public function copyElementToLanguageOfRelation()
@@ -219,7 +204,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/localizeContentOfRelation.csv
      */
     public function localizeContentOfRelation()
@@ -229,7 +213,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/localizeElementOfRelation.csv
      */
     public function localizeElementOfRelation()
@@ -239,7 +222,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/moveContentOfRelationToDifferentPage.csv
      */
     public function moveContentOfRelationToDifferentPage()
index db22769..5f75a2c 100644 (file)
@@ -47,7 +47,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
      */
 
     /**
-     * @test
      * @see DataSet/createContentRecordAndAddCategoryRelation.csv
      */
     public function createContentAndAddRelation()
@@ -61,7 +60,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/createCategoryRecordAndAddCategoryRelation.csv
      */
     public function createCategoryAndAddRelation()
@@ -75,7 +73,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/createContentRecordAndCreateCategoryRelation.csv
      */
     public function createContentAndCreateRelation()
@@ -92,7 +89,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
     }
 
     /**
-     * @test
      * @see DataSet/createCategoryRecordAndCreateCategoryRelation.csv
      */
     public function createCategoryAndCreateRelation()