‪TYPO3CMS  9.5
ProductionExceptionHandlerTest.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
19 use Psr\Log\NullLogger;
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
24 
28 class ‪ProductionExceptionHandlerTest extends UnitTestCase
29 {
33  protected ‪$subject;
34 
38  protected function ‪setUp(): void
39  {
40  $this->subject = new ‪ProductionExceptionHandler();
41  $this->subject->setLogger(new NullLogger());
42  }
46  public function ‪relayImmediateResponseException()
47  {
48  $response = $this->getMockBuilder(HtmlResponse::class)
49  ->disableOriginalConstructor()
50  ->getMock();
51  $exception = new ‪ImmediateResponseException($response, 1533939251);
52 
53  $this->expectException(ImmediateResponseException::class);
54  $this->subject->handle($exception);
55  }
56 }
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\Exception\ProductionExceptionHandlerTest
Definition: ProductionExceptionHandlerTest.php:29
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\Exception\ProductionExceptionHandlerTest\setUp
‪setUp()
Definition: ProductionExceptionHandlerTest.php:37
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\Exception\ProductionExceptionHandlerTest\$subject
‪ProductionExceptionHandler $subject
Definition: ProductionExceptionHandlerTest.php:32
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\Exception\ProductionExceptionHandlerTest\relayImmediateResponseException
‪relayImmediateResponseException()
Definition: ProductionExceptionHandlerTest.php:45
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\Exception
Definition: ProductionExceptionHandlerTest.php:4
‪TYPO3\CMS\Core\Http\ImmediateResponseException
Definition: ImmediateResponseException.php:29
‪TYPO3\CMS\Frontend\ContentObject\Exception\ProductionExceptionHandler
Definition: ProductionExceptionHandler.php:29
‪TYPO3\CMS\Core\Http\HtmlResponse
Definition: HtmlResponse.php:25