[TASK] Make FrontendWorkspaceRestrictionTest notice free
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Database / Query / Restriction / FrontendWorkspaceRestrictionTest.php
index c7b6083..19a8932 100644 (file)
@@ -20,11 +20,6 @@ use TYPO3\CMS\Frontend\Page\PageRepository;
 
 class FrontendWorkspaceRestrictionTest extends AbstractRestrictionTestCase
 {
-    /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
     /**
      * @test
      */
@@ -41,6 +36,9 @@ class FrontendWorkspaceRestrictionTest extends AbstractRestrictionTestCase
         $pageRepository = $this->createMock(PageRepository::class);
         $pageRepository->versioningPreview = false;
 
+        $GLOBALS['TSFE'] = new \stdClass();
+        $GLOBALS['TSFE']->sys_page = $pageRepository;
+
         $subject = new FrontendWorkspaceRestriction(0);
         $expression = $subject->buildExpression(['aTable' => 'aTable'], $this->expressionBuilder);
         $this->assertSame('("aTable"."t3ver_state" <= 0) AND ("aTable"."pid" <> -1)', (string)$expression);