Exception handling: Added NullHandler to be used in commands
parent
272be5eab2
commit
21ee2bd0d7
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Engelsystem\Exceptions\Handlers;
|
||||
|
||||
use Engelsystem\Http\Request;
|
||||
use Throwable;
|
||||
|
||||
class NullHandler extends Legacy
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param Throwable $e
|
||||
*/
|
||||
public function render($request, Throwable $e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Engelsystem\Test\Unit\Exceptions\Handlers;
|
||||
|
||||
use Engelsystem\Exceptions\Handlers\NullHandler;
|
||||
use Engelsystem\Http\Request;
|
||||
use ErrorException;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class NullHandlerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Engelsystem\Exceptions\Handlers\NullHandler::render
|
||||
*/
|
||||
public function testRender()
|
||||
{
|
||||
$handler = new NullHandler();
|
||||
$request = new Request();
|
||||
$exception = new ErrorException();
|
||||
|
||||
$this->expectOutputString('');
|
||||
$handler->render($request, $exception);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue