1
1
<?php namespace Lanin \Laravel \ApiExceptions \Tests ;
2
2
3
+ use Lanin \Laravel \ApiExceptions \InternalServerErrorApiException ;
4
+ use Symfony \Component \Debug \Exception \FatalErrorException ;
5
+
3
6
class TestExceptionsOutput extends TestCase
4
7
{
5
8
/**
@@ -48,7 +51,7 @@ public function test_validation_error()
48
51
public function test_internal_error_error ()
49
52
{
50
53
$ this ->app ['router ' ]->get ('foo ' , function () {
51
- $ new = new UndefinedClass ( );
54
+ throw new FatalErrorException ( ' Fatal error. ' , 0 , 1 , __FILE__ , __LINE__ );
52
55
});
53
56
54
57
$ this ->json ('GET ' , '/foo ' )
@@ -66,13 +69,14 @@ public function test_internal_error_in_debug_mode()
66
69
putenv ('APP_DEBUG=true ' );
67
70
68
71
$ this ->app ['router ' ]->get ('foo ' , function () {
69
- $ new = new UndefinedClass ( );
72
+ throw new FatalErrorException ( ' Fatal error. ' , 0 , 1 , __FILE__ , __LINE__ );
70
73
});
71
74
72
75
$ this ->json ('GET ' , '/foo ' )
73
76
->seeStatusCode (500 )
74
77
->seeJsonContains ([
75
- 'id ' => 'fatal_throwable_error ' ,
78
+ 'id ' => 'fatal_error_exception ' ,
79
+ 'message ' => 'Fatal error. '
76
80
])
77
81
->seeJsonMatchesPath ('$.trace ' );
78
82
}
0 commit comments