Skip to content

Commit

Permalink
[TASK] Make WebProcessorTest notice free
Browse files Browse the repository at this point in the history
Resolves: #84371
Releases: master
Change-Id: I8757018564757a7768265a615ab6295851695c37
Reviewed-on: https://review.typo3.org/56251
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>
  • Loading branch information
lsascha authored and lolli42 committed Mar 16, 2018
1 parent 16e7203 commit f09dbbf
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions typo3/sysext/core/Tests/Unit/Log/Processor/WebProcessorTest.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types = 1);
namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;

/*
Expand All @@ -14,24 +15,32 @@
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Core\Log\LogLevel;
use TYPO3\CMS\Core\Log\LogRecord;
use TYPO3\CMS\Core\Log\Processor\WebProcessor;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;

/**
* Test case
*/
class WebProcessorTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
class WebProcessorTest extends UnitTestCase
{
/**
* Subject is not notice free, disable E_NOTICES
*/
protected static $suppressNotices = true;

/**
* @test
*/
public function webProcessorAddsWebDataToLogRecord()
{
$environmentVariables = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('_ARRAY');
$logRecord = new \TYPO3\CMS\Core\Log\LogRecord('test.core.log', \TYPO3\CMS\Core\Log\LogLevel::DEBUG, 'test');
$processor = new \TYPO3\CMS\Core\Log\Processor\WebProcessor();
$_SERVER['PATH_INFO'] = '';
$_SERVER['REQUEST_URI'] = '';
$_SERVER['ORIG_SCRIPT_NAME'] = '';
$_SERVER['REMOTE_ADDR'] = '';
$_SERVER['QUERY_STRING'] = '';
$_SERVER['SSL_SESSION_ID'] = '';

$environmentVariables = GeneralUtility::getIndpEnv('_ARRAY');
$logRecord = new LogRecord('test.core.log', LogLevel::DEBUG, 'test');
$processor = new WebProcessor();
$logRecord = $processor->processLogRecord($logRecord);
foreach ($environmentVariables as $key => $value) {
$this->assertEquals($value, $logRecord['data'][$key]);
Expand Down

0 comments on commit f09dbbf

Please sign in to comment.