[TASK] Make extbase/Tests/Unit/Persistence/Generic/Storage/ notice free 26/57226/5
authorJan Helke <typo3@helke.de>
Fri, 15 Jun 2018 10:57:55 +0000 (12:57 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 14 Aug 2018 13:38:14 +0000 (15:38 +0200)
Releases: master
Resolves: #85269
Change-Id: Id9037ca76e3279b00ecdd1266b2665447278a8e8
Reviewed-on: https://review.typo3.org/57226
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbBackendTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbQueryParserTest.php
typo3/sysext/frontend/Classes/Page/PageRepository.php

index 37fe2ef..b6fa297 100644 (file)
@@ -257,12 +257,12 @@ class BackendUtility
 
         if (is_array($ctrl)) {
             if (is_array($ctrl['enablecolumns'])) {
-                if ($ctrl['enablecolumns']['disabled']) {
+                if ($ctrl['enablecolumns']['disabled'] ?? false) {
                     $field = $table . '.' . $ctrl['enablecolumns']['disabled'];
                     $query->add($expressionBuilder->eq($field, 0));
                     $invQuery->add($expressionBuilder->neq($field, 0));
                 }
-                if ($ctrl['enablecolumns']['starttime']) {
+                if ($ctrl['enablecolumns']['starttime'] ?? false) {
                     $field = $table . '.' . $ctrl['enablecolumns']['starttime'];
                     $query->add($expressionBuilder->lte($field, (int)$GLOBALS['SIM_ACCESS_TIME']));
                     $invQuery->add(
@@ -272,7 +272,7 @@ class BackendUtility
                         )
                     );
                 }
-                if ($ctrl['enablecolumns']['endtime']) {
+                if ($ctrl['enablecolumns']['endtime'] ?? false) {
                     $field = $table . '.' . $ctrl['enablecolumns']['endtime'];
                     $query->add(
                         $expressionBuilder->orX(
index 9afec93..af158ea 100644 (file)
@@ -25,18 +25,14 @@ use TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Extbase\Service\EnvironmentService;
 use TYPO3\CMS\Frontend\Page\PageRepository;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 /**
  * Test case
  */
-class Typo3DbBackendTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class Typo3DbBackendTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * Due to nested PageRepository / FrontendRestriction Container issues, the Context object is set
      * @var bool
      */
index a00d4d7..8fa8b8c 100644 (file)
@@ -31,15 +31,11 @@ use TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface;
 use TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface;
 use TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser;
 use TYPO3\CMS\Extbase\Persistence\QueryInterface;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
-class Typo3DbQueryParserTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class Typo3DbQueryParserTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * Clean up after tests
      */
     protected function tearDown()
index 0f28865..c010b3a 100644 (file)
@@ -1502,7 +1502,7 @@ class PageRepository implements LoggerAwareInterface
             if ($ctrl['delete']) {
                 $constraints[] = $expressionBuilder->eq($table . '.' . $ctrl['delete'], 0);
             }
-            if ($ctrl['versioningWS']) {
+            if ($ctrl['versioningWS'] ?? false) {
                 if (!$this->versioningWorkspaceId) {
                     // Filter out placeholder records (new/moved/deleted items)
                     // in case we are NOT in a versioning preview (that means we are online!)
@@ -1545,7 +1545,7 @@ class PageRepository implements LoggerAwareInterface
                             $expressionBuilder->gt($field, (int)$GLOBALS['SIM_ACCESS_TIME'])
                         );
                     }
-                    if ($ctrl['enablecolumns']['fe_group'] && !$ignore_array['fe_group']) {
+                    if (($ctrl['enablecolumns']['fe_group'] ?? false) && !($ignore_array['fe_group'] ?? false)) {
                         $field = $table . '.' . $ctrl['enablecolumns']['fe_group'];
                         $constraints[] = QueryHelper::stripLogicalOperatorPrefix(
                             $this->getMultipleGroupsWhereClause($field, $table)
@@ -1743,7 +1743,7 @@ class PageRepository implements LoggerAwareInterface
                     // Changing input record to the workspace version alternative:
                     $row = $wsAlt;
                     // Check if it is deleted/new
-                    $rowVersionState = VersionState::cast($row['t3ver_state']);
+                    $rowVersionState = VersionState::cast($row['t3ver_state'] ?? null);
                     if (
                         $rowVersionState->equals(VersionState::NEW_PLACEHOLDER)
                         || $rowVersionState->equals(VersionState::DELETE_PLACEHOLDER)