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

Resolves: #84423
Releases: master
Change-Id: I80afac2368be1c36053ad89edb129e56175ba2a8
Reviewed-on: https://review.typo3.org/56294
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>
---
 .../AbstractUserAuthenticationTest.php          | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/typo3/sysext/core/Tests/Unit/Authentication/AbstractUserAuthenticationTest.php b/typo3/sysext/core/Tests/Unit/Authentication/AbstractUserAuthenticationTest.php
index 470e6a97d11e..56f3eec0ac89 100644
--- a/typo3/sysext/core/Tests/Unit/Authentication/AbstractUserAuthenticationTest.php
+++ b/typo3/sysext/core/Tests/Unit/Authentication/AbstractUserAuthenticationTest.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types = 1);
 namespace TYPO3\CMS\Core\Tests\Unit\Authentication;
 
 /*
@@ -14,30 +15,30 @@ namespace TYPO3\CMS\Core\Tests\Unit\Authentication;
  * The TYPO3 project - inspiring people to share!
  */
 
+use Doctrine\DBAL\Query\QueryBuilder as DoctrineQueryBuilder;
 use Prophecy\Argument;
 use Prophecy\Prophecy\ObjectProphecy;
+use TYPO3\CMS\Core\Authentication\AbstractUserAuthentication;
 use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder;
 use TYPO3\CMS\Core\Database\Query\QueryBuilder;
 use TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 /**
  * Testcase for class \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication
  */
-class AbstractUserAuthenticationTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class AbstractUserAuthenticationTest extends UnitTestCase
 {
-    /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
     /**
      * @test
      */
     public function getAuthInfoArrayReturnsEmptyPidListIfNoCheckPidValueIsGiven()
     {
+        $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
+
         /** @var Connection|ObjectProphecy $connection */
         $connection = $this->prophesize(Connection::class);
         $connection->getDatabasePlatform()->willReturn(new MockPlatform());
@@ -48,7 +49,7 @@ class AbstractUserAuthenticationTest extends \TYPO3\TestingFramework\Core\Unit\U
         $queryBuilder = new QueryBuilder(
             $connection->reveal(),
             null,
-            $this->prophesize(\Doctrine\DBAL\Query\QueryBuilder::class)->reveal()
+            $this->prophesize(DoctrineQueryBuilder::class)->reveal()
         );
 
         /** @var ConnectionPool|ObjectProphecy $connection */
@@ -58,7 +59,7 @@ class AbstractUserAuthenticationTest extends \TYPO3\TestingFramework\Core\Unit\U
         GeneralUtility::addInstance(ConnectionPool::class, $connectionPool->reveal());
 
         /** @var $mock \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication */
-        $mock = $this->getMockBuilder(\TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::class)
+        $mock = $this->getMockBuilder(AbstractUserAuthentication::class)
             ->setMethods(['dummy'])
             ->getMock();
         $mock->checkPid = true;
-- 
GitLab