2017-11-02 18:56:01 +01:00
|
|
|
<?php declare(strict_types=1);
|
2016-10-09 13:15:24 +02:00
|
|
|
|
|
|
|
namespace PhpParser\ErrorHandler;
|
|
|
|
|
|
|
|
use PhpParser\Error;
|
2017-04-27 18:14:07 +02:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2016-10-09 13:15:24 +02:00
|
|
|
|
2017-04-27 18:14:07 +02:00
|
|
|
class ThrowingTest extends TestCase
|
|
|
|
{
|
2016-10-09 13:15:24 +02:00
|
|
|
public function testHandleError() {
|
2018-09-22 10:43:54 +02:00
|
|
|
$this->expectException(Error::class);
|
|
|
|
$this->expectExceptionMessage('Test');
|
2016-10-09 13:15:24 +02:00
|
|
|
$errorHandler = new Throwing();
|
|
|
|
$errorHandler->handleError(new Error('Test'));
|
|
|
|
}
|
2017-04-27 18:14:07 +02:00
|
|
|
}
|