1717use Chevere \Http \Exceptions \ControllerException ;
1818use Chevere \Tests \src \ControllerThrowsControllerException ;
1919use Chevere \Tests \src \ControllerThrowsControllerExceptionDefault ;
20- use Chevere \Tests \src \ControllerWrongReturnControllerException ;
2120use Exception ;
2221use InvalidArgumentException ;
2322use PHPUnit \Framework \TestCase ;
2423use Throwable ;
25- use TypeError ;
2624
2725final class ControllerExceptionTest extends TestCase
2826{
@@ -52,7 +50,6 @@ public function testThrowsDefaults(): void
5250 $ this ->assertSame ('' , $ e ->getMessage ());
5351 $ this ->assertSame (0 , $ e ->getCode ());
5452 $ this ->assertNull ($ e ->getPrevious ());
55- $ this ->assertNull ($ e ->return );
5653 }
5754 }
5855
@@ -66,26 +63,6 @@ public function testThrows(): void
6663 $ this ->assertSame (123 , $ e ->getCode ());
6764 $ this ->assertInstanceOf (Exception::class, $ e ->getPrevious ());
6865 $ this ->assertSame ('previous ' , $ e ->getPrevious ()->getMessage ());
69- $ this ->assertSame (1.5 , $ e ->return );
70- }
71- }
72-
73- public function testWrongReturn (): void
74- {
75- try {
76- new ControllerWrongReturnControllerException ();
77- } catch (Throwable $ e ) {
78- $ this ->assertInstanceOf (ActionException::class, $ e );
79- $ this ->assertSame (
80- 'Argument `$return` value is not compatible with return type defined in Chevere\Tests\src\ControllerWrongReturnControllerException::return() method ' ,
81- $ e ->getMessage ()
82- );
83- $ this ->assertSame (TypeError::class, $ e ->getPrevious ()::class);
84- $ this ->assertSame (
85- __DIR__ . '/src/ControllerWrongReturnControllerException.php ' ,
86- $ e ->getFile ()
87- );
88- $ this ->assertSame (25 , $ e ->getLine ());
8966 }
9067 }
9168}
0 commit comments