[FEATURE] Allow adding additional query restrictions 41/56341/20
authorHelmut Hummel <typo3@helhum.io>
Fri, 11 May 2018 22:33:04 +0000 (00:33 +0200)
committerHelmut Hummel <typo3@helhum.io>
Sun, 13 May 2018 21:16:55 +0000 (23:16 +0200)
Make it possible to add additional query restrictions,
that will be applied to every query.

Resolves: #84244
Releases: master, 8.7
Change-Id: I0d0a5546629587306e537da51d8a2557d7e95fce
Reviewed-on: https://review.typo3.org/56341
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Tested-by: Helmut Hummel <typo3@helhum.io>
16 files changed:
typo3/sysext/core/Classes/Database/Query/QueryBuilder.php
typo3/sysext/core/Classes/Database/Query/Restriction/AbstractRestrictionContainer.php
typo3/sysext/core/Classes/Database/Query/Restriction/EnforceableQueryRestrictionInterface.php [new file with mode: 0644]
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Documentation/Changelog/master/Feature-84244-AllowAddingAdditionalQueryrestrictions.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Database/Mocks/InstantiatableAbstractRestrictionContainer.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Database/Query/QueryBuilderTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/AbstractRestrictionContainerTest.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/BackendWorkspaceRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/DefaultRestrictionContainerTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/DeletedRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/EndTimeRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendGroupRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendRestrictionContainerTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/HiddenRestrictionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/StartTimeRestrictionTest.php

index 93f272e..b902ac1 100644 (file)
@@ -59,19 +59,27 @@ class QueryBuilder
     protected $restrictionContainer;
 
     /**
+     * @var array
+     */
+    protected $additionalRestrictions;
+
+    /**
      * Initializes a new QueryBuilder.
      *
      * @param Connection $connection The DBAL Connection.
      * @param QueryRestrictionContainerInterface $restrictionContainer
      * @param \Doctrine\DBAL\Query\QueryBuilder $concreteQueryBuilder
+     * @param array $additionalRestrictions
      */
     public function __construct(
         Connection $connection,
         QueryRestrictionContainerInterface $restrictionContainer = null,
-        \Doctrine\DBAL\Query\QueryBuilder $concreteQueryBuilder = null
+        \Doctrine\DBAL\Query\QueryBuilder $concreteQueryBuilder = null,
+        array $additionalRestrictions = null
     ) {
         $this->connection = $connection;
-        $this->restrictionContainer = $restrictionContainer ?: GeneralUtility::makeInstance(DefaultRestrictionContainer::class);
+        $this->additionalRestrictions = $additionalRestrictions ?: $GLOBALS['TYPO3_CONF_VARS']['DB']['additionalQueryRestrictions'] ?? [];
+        $this->setRestrictions($restrictionContainer ?: GeneralUtility::makeInstance(DefaultRestrictionContainer::class));
         $this->concreteQueryBuilder = $concreteQueryBuilder ?: GeneralUtility::makeInstance(\Doctrine\DBAL\Query\QueryBuilder::class, $connection);
     }
 
@@ -88,6 +96,12 @@ class QueryBuilder
      */
     public function setRestrictions(QueryRestrictionContainerInterface $restrictionContainer)
     {
+        foreach ($this->additionalRestrictions as $restrictionClass => $options) {
+            if (empty($options['disabled'])) {
+                $restriction = GeneralUtility::makeInstance($restrictionClass);
+                $restrictionContainer->add($restriction);
+            }
+        }
         $this->restrictionContainer = $restrictionContainer;
     }
 
@@ -96,7 +110,7 @@ class QueryBuilder
      */
     public function resetRestrictions()
     {
-        $this->restrictionContainer = GeneralUtility::makeInstance(DefaultRestrictionContainer::class);
+        $this->setRestrictions(GeneralUtility::makeInstance(DefaultRestrictionContainer::class));
     }
 
     /**
@@ -1097,8 +1111,6 @@ class QueryBuilder
             $this->concreteQueryBuilder->andWhere($expression);
         }
 
-        // @todo add hook to be able to add additional restrictions
-
         return $originalWhereConditions;
     }
 
index 459fc30..2b6f4df 100644 (file)
@@ -30,6 +30,11 @@ abstract class AbstractRestrictionContainer implements QueryRestrictionContainer
     protected $restrictions = [];
 
     /**
+     * @var QueryRestrictionInterface[]
+     */
+    protected $enforcedRestrictions = [];
+
+    /**
      * Main method to build expressions for given tables.
      * Iterating over all registered expressions and combine them with AND
      *
@@ -51,9 +56,9 @@ abstract class AbstractRestrictionContainer implements QueryRestrictionContainer
      *
      * @return QueryRestrictionContainerInterface
      */
-    public function removeAll()
+    public function removeAll(): QueryRestrictionContainerInterface
     {
-        $this->restrictions = [];
+        $this->restrictions = $this->enforcedRestrictions;
         return $this;
     }
 
@@ -63,9 +68,9 @@ abstract class AbstractRestrictionContainer implements QueryRestrictionContainer
      * @param string $restrictionType Class name of the restriction to be removed
      * @return QueryRestrictionContainerInterface
      */
-    public function removeByType(string $restrictionType)
+    public function removeByType(string $restrictionType): QueryRestrictionContainerInterface
     {
-        unset($this->restrictions[$restrictionType]);
+        unset($this->restrictions[$restrictionType], $this->enforcedRestrictions[$restrictionType]);
         return $this;
     }
 
@@ -75,9 +80,12 @@ abstract class AbstractRestrictionContainer implements QueryRestrictionContainer
      * @param QueryRestrictionInterface $restriction
      * @return QueryRestrictionContainerInterface
      */
-    public function add(QueryRestrictionInterface $restriction)
+    public function add(QueryRestrictionInterface $restriction): QueryRestrictionContainerInterface
     {
         $this->restrictions[get_class($restriction)] = $restriction;
+        if ($restriction instanceof EnforceableQueryRestrictionInterface && $restriction->isEnforced()) {
+            $this->enforcedRestrictions[get_class($restriction)] = $restriction;
+        }
         return $this;
     }
 
@@ -88,7 +96,7 @@ abstract class AbstractRestrictionContainer implements QueryRestrictionContainer
      * @param string $restrictionClass
      * @return QueryRestrictionInterface
      */
-    protected function createRestriction($restrictionClass)
+    protected function createRestriction($restrictionClass): QueryRestrictionInterface
     {
         return GeneralUtility::makeInstance($restrictionClass);
     }
diff --git a/typo3/sysext/core/Classes/Database/Query/Restriction/EnforceableQueryRestrictionInterface.php b/typo3/sysext/core/Classes/Database/Query/Restriction/EnforceableQueryRestrictionInterface.php
new file mode 100644 (file)
index 0000000..108a7cb
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+declare(strict_types = 1);
+namespace TYPO3\CMS\Core\Database\Query\Restriction;
+
+/*
+ * 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!
+ */
+
+/**
+ * Can be added to QueryRestrictionInterface implementations.
+ * Restrictions implementing this interface will not be removed when removeAll()
+ * is called on the container and isEnforced() returns true.
+ * It can be removed though, when explicitly calling removeByType()
+ */
+interface EnforceableQueryRestrictionInterface
+{
+    /**
+     * When returning false, restriction will be removed when removeAll()
+     * is called on the container
+     *
+     * @return bool
+     */
+    public function isEnforced(): bool;
+}
index a3f99c3..1253444 100644 (file)
@@ -19,6 +19,9 @@
  * The description of the various options is stored in the DefaultConfigurationDescription.yaml file
  */
 return [
+    'DB' => [
+        'additionalQueryRestrictions' => [],
+    ],
     'GFX' => [ // Configuration of the image processing features in TYPO3. 'IM' and 'GD' are short for ImageMagick and GD library respectively.
         'thumbnails' => true,
         'thumbnails_png' => true,
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-84244-AllowAddingAdditionalQueryrestrictions.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-84244-AllowAddingAdditionalQueryrestrictions.rst
new file mode 100644 (file)
index 0000000..b471eac
--- /dev/null
@@ -0,0 +1,48 @@
+.. include:: ../../Includes.txt
+
+============================================================
+Feature: #84244 - Allow adding additional query restrictions
+============================================================
+
+See :issue:`84244`
+
+Description
+===========
+
+It is now possible to add additional query restrictions by adding class names as key to :php:`$GLOBALS['TYPO3_CONF_VARS']['DB']['additionalQueryRestrictions']`
+These restriction objects will be added to any select query executed using the QueryBuilder.
+
+If these added restriction objects additionally implement :php:`\TYPO3\CMS\Core\Database\Query\Restriction\EnforceableQueryRestrictionInterface`
+and return true in the to be implemented method :php:`isEnforced()`, calling :php:`$queryBuilder->getRestrictions()->removeAll()`
+such restrictions will **still** be applied to the query.
+
+If an enforced restriction must be removed, it can still be removed with :php:`$queryBuilder->->getRestrictions()->removeByType(SomeClass::class);`
+
+Implementers of custom restrictions can therefore have their restrictions always enforced, or even not applied at all,
+by returning an empty expression in certain cases.
+
+To add a custom restriction class, use the following snippet in a `ext_localconf.php` file of your extension:
+
+.. code-block:: php
+
+    if (!isset($GLOBALS['TYPO3_CONF_VARS']['DB']['additionalQueryRestrictions'][\Vendor\ExtName\Database\Query\Restriction\CustomRestriction::class])) {
+        $GLOBALS['TYPO3_CONF_VARS']['DB']['additionalQueryRestrictions'][\Vendor\ExtName\Database\Query\Restriction\CustomRestriction::class] = [];
+    }
+
+Please note, that the class name must be the array key and the value must always be an array, which is reserved for options
+given to the restriction objects.
+
+Impact
+======
+
+Restrictions added by third party extensions will impact the whole system. Therefore this API does not allow removing restrictions
+added by the system and adding restrictions should be handled with care.
+
+Removing third party restrictions is possible, by setting the option value `disabled` for a restriction to `true`
+in global TYPO3 configuration or `ext_localconf.php` of an extension, like shown below.
+
+.. code-block:: php
+
+    $GLOBALS['TYPO3_CONF_VARS']['DB']['additionalQueryRestrictions'][\Vendor\ExtName\Database\Query\Restriction\CustomRestriction::class]['disabled'] = true;
+
+.. index:: Backend, Database, Frontend, ext:core
diff --git a/typo3/sysext/core/Tests/Unit/Database/Mocks/InstantiatableAbstractRestrictionContainer.php b/typo3/sysext/core/Tests/Unit/Database/Mocks/InstantiatableAbstractRestrictionContainer.php
new file mode 100644 (file)
index 0000000..7d927f1
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\Unit\Database\Mocks;
+
+/*
+ * 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\Database\Query\Restriction\AbstractRestrictionContainer;
+
+class InstantiatableAbstractRestrictionContainer extends AbstractRestrictionContainer
+{
+}
index 49755aa..e7577e7 100644 (file)
@@ -23,7 +23,10 @@ use Prophecy\Argument;
 use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder;
 use TYPO3\CMS\Core\Database\Query\QueryBuilder;
+use TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer;
+use TYPO3\CMS\Core\Database\Query\Restriction\DefaultRestrictionContainer;
 use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
+use TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionInterface;
 use TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
@@ -65,8 +68,7 @@ class QueryBuilderTest extends UnitTestCase
         $this->connection = $this->prophesize(Connection::class);
         $this->connection->getDatabasePlatform()->willReturn(new MockPlatform());
 
-        $this->subject = GeneralUtility::makeInstance(
-            QueryBuilder::class,
+        $this->subject = new QueryBuilder(
             $this->connection->reveal(),
             null,
             $this->concreteQueryBuilder->reveal()
@@ -1266,4 +1268,85 @@ class QueryBuilderTest extends UnitTestCase
 
         $this->assertSame($expectedCountSQL, $clonedQueryBuilder->getSQL());
     }
+
+    /**
+     * @test
+     */
+    public function settingRestrictionContainerWillAddAdditionalRestrictionsFromConstructor()
+    {
+        $restrictionClass = get_class($this->prophesize(QueryRestrictionInterface::class)->reveal());
+        $queryBuilder = new QueryBuilder(
+            $this->connection->reveal(),
+            null,
+            $this->concreteQueryBuilder->reveal(),
+            [
+                $restrictionClass => [],
+            ]
+        );
+
+        $container = $this->prophesize(AbstractRestrictionContainer::class);
+        $container->add(new $restrictionClass())->shouldBeCalled();
+
+        $queryBuilder->setRestrictions($container->reveal());
+    }
+
+    /**
+     * @test
+     */
+    public function settingRestrictionContainerWillAddAdditionalRestrictionsFromConfiguration()
+    {
+        $restrictionClass = get_class($this->prophesize(QueryRestrictionInterface::class)->reveal());
+        $GLOBALS['TYPO3_CONF_VARS']['DB']['additionalQueryRestrictions'][$restrictionClass] = [];
+        $queryBuilder = new QueryBuilder(
+            $this->connection->reveal(),
+            null,
+            $this->concreteQueryBuilder->reveal()
+        );
+
+        $container = $this->prophesize(AbstractRestrictionContainer::class);
+        $container->add(new $restrictionClass())->shouldBeCalled();
+
+        $queryBuilder->setRestrictions($container->reveal());
+    }
+
+    /**
+     * @test
+     */
+    public function settingRestrictionContainerWillNotAddAdditionalRestrictionsFromConfigurationIfNotDisabled()
+    {
+        $restrictionClass = get_class($this->prophesize(QueryRestrictionInterface::class)->reveal());
+        $GLOBALS['TYPO3_CONF_VARS']['DB']['additionalQueryRestrictions'][$restrictionClass] = ['disabled' => true];
+        $queryBuilder = new QueryBuilder(
+            $this->connection->reveal(),
+            null,
+            $this->concreteQueryBuilder->reveal()
+        );
+
+        $container = $this->prophesize(AbstractRestrictionContainer::class);
+        $container->add(new $restrictionClass())->shouldNotBeCalled();
+
+        $queryBuilder->setRestrictions($container->reveal());
+    }
+
+    /**
+     * @test
+     */
+    public function resettingToDefaultRestrictionContainerWillAddAdditionalRestrictionsFromConfiguration()
+    {
+        $restrictionClass = get_class($this->prophesize(QueryRestrictionInterface::class)->reveal());
+        $queryBuilder = new QueryBuilder(
+            $this->connection->reveal(),
+            null,
+            $this->concreteQueryBuilder->reveal(),
+            [
+                $restrictionClass => [],
+            ]
+        );
+
+        $container = $this->prophesize(DefaultRestrictionContainer::class);
+        $container->add(new $restrictionClass())->shouldBeCalled();
+        GeneralUtility::addInstance(DefaultRestrictionContainer::class, $container->reveal());
+
+        $queryBuilder->resetRestrictions();
+    }
 }
diff --git a/typo3/sysext/core/Tests/Unit/Database/Query/Restriction/AbstractRestrictionContainerTest.php b/typo3/sysext/core/Tests/Unit/Database/Query/Restriction/AbstractRestrictionContainerTest.php
new file mode 100644 (file)
index 0000000..af88cc1
--- /dev/null
@@ -0,0 +1,122 @@
+<?php
+declare(strict_types = 1);
+namespace TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction;
+
+/*
+ * 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\Database\Query\Expression\CompositeExpression;
+use TYPO3\CMS\Core\Database\Query\Restriction\EnforceableQueryRestrictionInterface;
+use TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionInterface;
+use TYPO3\CMS\Core\Tests\Unit\Database\Mocks\InstantiatableAbstractRestrictionContainer;
+
+class AbstractRestrictionContainerTest extends AbstractRestrictionTestCase
+{
+    /**
+     * @test
+     */
+    public function enforceableRestrictionsAreKeptWhenRemoveAllIsCalled()
+    {
+        $restriction = $this->prophesize();
+        $restriction->willImplement(QueryRestrictionInterface::class);
+        $restriction->willImplement(EnforceableQueryRestrictionInterface::class);
+        $restriction->buildExpression(['aTable' => 'aTable'], $this->expressionBuilder)
+            ->shouldBeCalled()
+            ->willReturn(new CompositeExpression(CompositeExpression::TYPE_AND, ['"aTable"."pid" = 0']));
+        $restriction->isEnforced()->willReturn(true);
+
+        $subject = new InstantiatableAbstractRestrictionContainer();
+        $subject->add($restriction->reveal());
+        $subject->removeAll();
+
+        $expression = $subject->buildExpression(['aTable' => 'aTable'], $this->expressionBuilder);
+        $this->assertSame('"aTable"."pid" = 0', (string)$expression);
+    }
+
+    /**
+     * @test
+     */
+    public function enforceableRestrictionsWillBeRemovedWhenRemovedByType()
+    {
+        $restriction = $this->prophesize();
+        $restriction->willImplement(QueryRestrictionInterface::class);
+        $restriction->willImplement(EnforceableQueryRestrictionInterface::class);
+        $restriction->buildExpression()->shouldNotBeCalled();
+        $restriction->isEnforced()->willReturn(true);
+
+        $subject = new InstantiatableAbstractRestrictionContainer();
+        $restriction = $restriction->reveal();
+        $subject->add($restriction);
+        $subject->removeByType(get_class($restriction));
+
+        $expression = $subject->buildExpression(['aTable' => 'aTable'], $this->expressionBuilder);
+        $this->assertSame('', (string)$expression);
+    }
+
+    /**
+     * @test
+     */
+    public function enforceableRestrictionsWillBeRemovedWhenRemovedByTypeAndRemovedAllIsAdditionallyCalled()
+    {
+        $restriction = $this->prophesize();
+        $restriction->willImplement(QueryRestrictionInterface::class);
+        $restriction->willImplement(EnforceableQueryRestrictionInterface::class);
+        $restriction->buildExpression()->shouldNotBeCalled();
+        $restriction->isEnforced()->willReturn(true);
+
+        $subject = new InstantiatableAbstractRestrictionContainer();
+        $restriction = $restriction->reveal();
+        $subject->add($restriction);
+        $subject->removeByType(get_class($restriction));
+        $subject->removeAll();
+
+        $expression = $subject->buildExpression(['aTable' => 'aTable'], $this->expressionBuilder);
+        $this->assertSame('', (string)$expression);
+    }
+
+    /**
+     * @test
+     */
+    public function notEnforceableRestrictionsAreRemovedWhenRemoveAllIsCalled()
+    {
+        $restriction = $this->prophesize();
+        $restriction->willImplement(QueryRestrictionInterface::class);
+        $restriction->buildExpression()->shouldNotBeCalled();
+
+        $subject = new InstantiatableAbstractRestrictionContainer();
+        $subject->add($restriction->reveal());
+        $subject->removeAll();
+
+        $expression = $subject->buildExpression(['aTable' => 'aTable'], $this->expressionBuilder);
+        $this->assertSame('', (string)$expression);
+    }
+
+    /**
+     * @test
+     */
+    public function enforceableRestrictionsThatDeclareThemselvesNonStickyAreRemovedWhenRemoveAllIsCalled()
+    {
+        $restriction = $this->prophesize();
+        $restriction->willImplement(QueryRestrictionInterface::class);
+        $restriction->willImplement(EnforceableQueryRestrictionInterface::class);
+        $restriction->buildExpression()->shouldNotBeCalled();
+        $restriction->isEnforced()->willReturn(false);
+
+        $subject = new InstantiatableAbstractRestrictionContainer();
+        $subject->add($restriction->reveal());
+        $subject->removeAll();
+
+        $expression = $subject->buildExpression(['aTable' => 'aTable'], $this->expressionBuilder);
+        $this->assertSame('', (string)$expression);
+    }
+}
index 558565d..dd0c2d8 100644 (file)
@@ -20,13 +20,6 @@ use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
 class BackendWorkspaceRestrictionTest extends AbstractRestrictionTestCase
 {
     /**
-     */
-    protected function setUp()
-    {
-        parent::setUp();
-    }
-
-    /**
      * @test
      */
     public function buildExpressionAddsLiveWorkspaceWhereClause()
index 0914253..6d4a787 100644 (file)
@@ -20,13 +20,6 @@ use TYPO3\CMS\Core\Database\Query\Restriction\DefaultRestrictionContainer;
 class DefaultRestrictionContainerTest extends AbstractRestrictionTestCase
 {
     /**
-     */
-    protected function setUp()
-    {
-        parent::setUp();
-    }
-
-    /**
      * @test
      */
     public function buildRestrictionsAddsAllDefaultRestrictions()
index e209c54..b416c75 100644 (file)
@@ -20,13 +20,6 @@ use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
 class DeletedRestrictionTest extends AbstractRestrictionTestCase
 {
     /**
-     */
-    protected function setUp()
-    {
-        parent::setUp();
-    }
-
-    /**
      * @test
      */
     public function buildRestrictionsAddsDeletedWhereClause()
index 217ffbb..889515e 100644 (file)
@@ -20,13 +20,6 @@ use TYPO3\CMS\Core\Database\Query\Restriction\EndTimeRestriction;
 class EndTimeRestrictionTest extends AbstractRestrictionTestCase
 {
     /**
-     */
-    protected function setUp()
-    {
-        parent::setUp();
-    }
-
-    /**
      * @test
      */
     public function buildRestrictionsThrowsExceptionInStartTimeIfGlobalsAccessTimeIsMissing()
index 8372c4f..78e7e0e 100644 (file)
@@ -20,13 +20,6 @@ use TYPO3\CMS\Core\Database\Query\Restriction\FrontendGroupRestriction;
 class FrontendGroupRestrictionTest extends AbstractRestrictionTestCase
 {
     /**
-     */
-    protected function setUp()
-    {
-        parent::setUp();
-    }
-
-    /**
      * @test
      */
     public function buildExpressionAddsNoAccessGroupWhereClause()
index b7f25f6..45be6d0 100644 (file)
@@ -20,13 +20,6 @@ use TYPO3\CMS\Frontend\Page\PageRepository;
 
 class FrontendRestrictionContainerTest extends AbstractRestrictionTestCase
 {
-    /**
-     */
-    protected function setUp()
-    {
-        parent::setUp();
-    }
-
     public function frontendStatesDataProvider()
     {
         return [
index 43a4aa4..c11580f 100644 (file)
@@ -20,13 +20,6 @@ use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
 class HiddenRestrictionTest extends AbstractRestrictionTestCase
 {
     /**
-     */
-    protected function setUp()
-    {
-        parent::setUp();
-    }
-
-    /**
      * @test
      */
     public function buildRestrictionsAddsHiddenWhereClause()
index 8b117d5..575632a 100644 (file)
@@ -20,13 +20,6 @@ use TYPO3\CMS\Core\Database\Query\Restriction\StartTimeRestriction;
 class StartTimeRestrictionTest extends AbstractRestrictionTestCase
 {
     /**
-     */
-    protected function setUp()
-    {
-        parent::setUp();
-    }
-
-    /**
      * @test
      */
     public function buildRestrictionsThrowsExceptionInStartTimeIfGlobalsAccessTimeIsMissing()