Skip to content

Commit e03e2d5

Browse files
author
Maxim Lanin
committed
Update internal error tests
1 parent 26f57a2 commit e03e2d5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/TestExceptionsOutput.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php namespace Lanin\Laravel\ApiExceptions\Tests;
22

3+
use Lanin\Laravel\ApiExceptions\InternalServerErrorApiException;
4+
use Symfony\Component\Debug\Exception\FatalErrorException;
5+
36
class TestExceptionsOutput extends TestCase
47
{
58
/**
@@ -48,7 +51,7 @@ public function test_validation_error()
4851
public function test_internal_error_error()
4952
{
5053
$this->app['router']->get('foo', function () {
51-
$new = new UndefinedClass();
54+
throw new FatalErrorException('Fatal error.', 0, 1, __FILE__, __LINE__);
5255
});
5356

5457
$this->json('GET', '/foo')
@@ -66,13 +69,14 @@ public function test_internal_error_in_debug_mode()
6669
putenv('APP_DEBUG=true');
6770

6871
$this->app['router']->get('foo', function () {
69-
$new = new UndefinedClass();
72+
throw new FatalErrorException('Fatal error.', 0, 1, __FILE__, __LINE__);
7073
});
7174

7275
$this->json('GET', '/foo')
7376
->seeStatusCode(500)
7477
->seeJsonContains([
75-
'id' => 'fatal_throwable_error',
78+
'id' => 'fatal_error_exception',
79+
'message' => 'Fatal error.'
7680
])
7781
->seeJsonMatchesPath('$.trace');
7882
}

0 commit comments

Comments
 (0)