[TASK] Make FrontendWorkspaceRestrictionTest notice free 99/56299/2
authorSascha Löffler <lsascha@gmail.com>
Sat, 17 Mar 2018 12:55:10 +0000 (13:55 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 17 Mar 2018 14:13:44 +0000 (15:13 +0100)
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>
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendWorkspaceRestrictionTest.php

index c7b6083..19a8932 100644 (file)
@@ -21,11 +21,6 @@ use TYPO3\CMS\Frontend\Page\PageRepository;
 class FrontendWorkspaceRestrictionTest extends AbstractRestrictionTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * @test
      */
     public function buildExpressionAddsLiveWorkspaceWhereClause()
@@ -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);