diff options
Diffstat (limited to 'vendor/symfony/http-kernel/Tests/Exception/HttpExceptionTest.php')
| -rw-r--r-- | vendor/symfony/http-kernel/Tests/Exception/HttpExceptionTest.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/vendor/symfony/http-kernel/Tests/Exception/HttpExceptionTest.php b/vendor/symfony/http-kernel/Tests/Exception/HttpExceptionTest.php index f5fe97255b..a9431f4b5a 100644 --- a/vendor/symfony/http-kernel/Tests/Exception/HttpExceptionTest.php +++ b/vendor/symfony/http-kernel/Tests/Exception/HttpExceptionTest.php @@ -46,8 +46,16 @@ class HttpExceptionTest extends TestCase $this->assertSame($headers, $exception->getHeaders()); } - protected function createException() + public function testThrowableIsAllowedForPrevious() { - return new HttpException(200); + $previous = new class('Error of PHP 7+') extends \Error { + }; + $exception = $this->createException(null, $previous); + $this->assertSame($previous, $exception->getPrevious()); + } + + protected function createException(string $message = null, \Throwable $previous = null, ?int $code = 0, array $headers = []) + { + return new HttpException(200, $message, $previous, $headers, $code); } } |
