From e5030d48a44e1f9140cf9e9bee477fde17096090 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sascha=20L=C3=B6ffler?= <lsascha@gmail.com>
Date: Sat, 17 Mar 2018 13:55:10 +0100
Subject: [PATCH] [TASK] Make FrontendWorkspaceRestrictionTest notice free

Resolves: #84428
Releases: master
Change-Id: I1e65bbb8ba91e6f1a1fc36d2c678c592361ca1dd
Reviewed-on: https://review.typo3.org/56299
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../Restriction/FrontendWorkspaceRestrictionTest.php      | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendWorkspaceRestrictionTest.php b/typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendWorkspaceRestrictionTest.php
index c7b608393ea9..19a8932f0b9c 100644
--- a/typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendWorkspaceRestrictionTest.php
+++ b/typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendWorkspaceRestrictionTest.php
@@ -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);
-- 
GitLab