[TASK] Make LogManagerTest notice free 25/56325/2
authorSascha Löffler <lsascha@gmail.com>
Sat, 17 Mar 2018 16:34:36 +0000 (17:34 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 17 Mar 2018 17:05:57 +0000 (18:05 +0100)
Resolves: #84446
Releases: master
Change-Id: Ib84f8414fb90bf1180bf495fd6b6c47430eb8ea2
Reviewed-on: https://review.typo3.org/56325
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/Log/LogManagerTest.php

index 92cf764..62e940a 100644 (file)
@@ -1,4 +1,5 @@
 <?php
 <?php
+declare(strict_types = 1);
 namespace TYPO3\CMS\Core\Tests\Unit\Log;
 
 /*
 namespace TYPO3\CMS\Core\Tests\Unit\Log;
 
 /*
@@ -14,29 +15,32 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log;
  * The TYPO3 project - inspiring people to share!
  */
 
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Log\Logger;
+use TYPO3\CMS\Core\Log\LogLevel;
+use TYPO3\CMS\Core\Log\LogManager;
+use TYPO3\CMS\Core\Log\Processor\NullProcessor;
+use TYPO3\CMS\Core\Log\Writer\NullWriter;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
+
 /**
  * Test case
  */
 /**
  * Test case
  */
-class LogManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class LogManagerTest extends UnitTestCase
 {
     /**
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * @var \TYPO3\CMS\Core\Log\LogManager
      */
     protected $logManagerInstance = null;
 
     protected function setUp()
     {
      * @var \TYPO3\CMS\Core\Log\LogManager
      */
     protected $logManagerInstance = null;
 
     protected function setUp()
     {
-        $this->logManagerInstance = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogManager::class);
+        $this->logManagerInstance = GeneralUtility::makeInstance(LogManager::class);
     }
 
     protected function tearDown()
     {
     }
 
     protected function tearDown()
     {
-        \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogManager::class)->reset();
+        GeneralUtility::makeInstance(LogManager::class)->reset();
         parent::tearDown();
     }
 
         parent::tearDown();
     }
 
@@ -45,7 +49,7 @@ class LogManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
      */
     public function logManagerReturnsLoggerWhenRequestedWithGetLogger()
     {
      */
     public function logManagerReturnsLoggerWhenRequestedWithGetLogger()
     {
-        $this->assertInstanceOf(\TYPO3\CMS\Core\Log\Logger::class, $this->logManagerInstance->getLogger('test'));
+        $this->assertInstanceOf(Logger::class, $this->logManagerInstance->getLogger('test'));
     }
 
     /**
     }
 
     /**
@@ -82,8 +86,8 @@ class LogManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     public function configuresLoggerWithConfiguredWriter()
     {
         $component = 'test';
     public function configuresLoggerWithConfiguredWriter()
     {
         $component = 'test';
-        $writer = \TYPO3\CMS\Core\Log\Writer\NullWriter::class;
-        $level = \TYPO3\CMS\Core\Log\LogLevel::DEBUG;
+        $writer = NullWriter::class;
+        $level = LogLevel::DEBUG;
         $GLOBALS['TYPO3_CONF_VARS']['LOG'][$component]['writerConfiguration'] = [
             $level => [
                 $writer => []
         $GLOBALS['TYPO3_CONF_VARS']['LOG'][$component]['writerConfiguration'] = [
             $level => [
                 $writer => []
@@ -101,8 +105,8 @@ class LogManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     public function configuresLoggerWithConfiguredProcessor()
     {
         $component = 'test';
     public function configuresLoggerWithConfiguredProcessor()
     {
         $component = 'test';
-        $processor = \TYPO3\CMS\Core\Log\Processor\NullProcessor::class;
-        $level = \TYPO3\CMS\Core\Log\LogLevel::DEBUG;
+        $processor = NullProcessor::class;
+        $level = LogLevel::DEBUG;
         $GLOBALS['TYPO3_CONF_VARS']['LOG'][$component]['processorConfiguration'] = [
             $level => [
                 $processor => []
         $GLOBALS['TYPO3_CONF_VARS']['LOG'][$component]['processorConfiguration'] = [
             $level => [
                 $processor => []