[TASK] Make ServerRequestFactoryTest notice free 40/56240/3
authorSascha Löffler <lsascha@gmail.com>
Fri, 16 Mar 2018 16:38:29 +0000 (17:38 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 16 Mar 2018 18:51:08 +0000 (19:51 +0100)
Resolves: #84362
Releases: master
Change-Id: Ief9d31b20d58f28cc777659a7a4d87663b3b17c5
Reviewed-on: https://review.typo3.org/56240
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/Http/ServerRequestFactoryTest.php

index 27a9b5e..e7c6d83 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types = 1);
 namespace TYPO3\CMS\Core\Tests\Unit\Http;
 
 /*
@@ -17,18 +18,14 @@ namespace TYPO3\CMS\Core\Tests\Unit\Http;
 use TYPO3\CMS\Core\Http\ServerRequestFactory;
 use TYPO3\CMS\Core\Http\UploadedFile;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 /**
  * Testcase for \TYPO3\CMS\Core\Http\ServerRequestFactory
  */
-class ServerRequestFactoryTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class ServerRequestFactoryTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * Set up
      */
     protected function setUp()
@@ -43,6 +40,8 @@ class ServerRequestFactoryTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     {
         $_SERVER['HTTP_HOST'] = 'localhost';
         $_SERVER['REQUEST_URI'] = '/index.php';
+        $_SERVER['REMOTE_ADDR'] = '';
+        $_SERVER['SSL_SESSION_ID'] = '';
         $_FILES = [
             'tx_uploadexample_piexample' => [
                 'name' => [
@@ -103,6 +102,8 @@ class ServerRequestFactoryTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     {
         $_SERVER['HTTP_HOST'] = 'localhost';
         $_SERVER['REQUEST_URI'] = '/index.php';
+        $_SERVER['REMOTE_ADDR'] = '';
+        $_SERVER['SSL_SESSION_ID'] = '';
         $_FILES = [];
 
         $uploadedFiles = ServerRequestFactory::fromGlobals()->getUploadedFiles();
@@ -117,6 +118,8 @@ class ServerRequestFactoryTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     {
         $_SERVER['HTTP_HOST'] = 'localhost';
         $_SERVER['REQUEST_URI'] = '/index.php';
+        $_SERVER['REMOTE_ADDR'] = '';
+        $_SERVER['SSL_SESSION_ID'] = '';
         $_FILES = [
             'tx_uploadexample_piexample' => [
                 'name' => '',