1414use RuntimeException ;
1515use Throwable ;
1616use Yiisoft \ErrorHandler \Middleware \ErrorCatcher ;
17- use Yiisoft \ErrorHandler \ThrowableResponseActionInterface ;
17+ use Yiisoft \ErrorHandler \ThrowableResponseFactoryInterface ;
1818use Yiisoft \Http \Status ;
1919
2020final class ErrorCatcherTest extends TestCase
2121{
2222 public function testSuccess (): void
2323 {
2424 $ errorCatcher = new ErrorCatcher (
25- $ this ->createThrowableResponseAction (),
25+ $ this ->createThrowableResponseFactory (),
2626 );
2727 $ handler = new class () implements RequestHandlerInterface {
2828 public function handle (ServerRequestInterface $ request ): ResponseInterface
@@ -41,7 +41,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
4141 public function testError (): void
4242 {
4343 $ errorCatcher = new ErrorCatcher (
44- $ this ->createThrowableResponseAction (),
44+ $ this ->createThrowableResponseFactory (),
4545 );
4646 $ response = $ errorCatcher ->process (
4747 new ServerRequest (),
@@ -56,7 +56,7 @@ public function testErrorWithEventDispatcher(): void
5656 $ eventDispatcher = $ this ->createMock (EventDispatcherInterface::class);
5757 $ eventDispatcher ->method ('dispatch ' )->willThrowException (new RuntimeException ('Event dispatcher error ' ));
5858 $ errorCatcher = new ErrorCatcher (
59- $ this ->createThrowableResponseAction (),
59+ $ this ->createThrowableResponseFactory (),
6060 $ eventDispatcher ,
6161 );
6262 $ response = $ errorCatcher ->process (
@@ -66,9 +66,9 @@ public function testErrorWithEventDispatcher(): void
6666 $ this ->assertSame (Status::INTERNAL_SERVER_ERROR , $ response ->getStatusCode ());
6767 }
6868
69- private function createThrowableResponseAction (): ThrowableResponseActionInterface
69+ private function createThrowableResponseFactory (): ThrowableResponseFactoryInterface
7070 {
71- return new class () implements ThrowableResponseActionInterface {
71+ return new class () implements ThrowableResponseFactoryInterface {
7272 public function handle (ServerRequestInterface $ request , Throwable $ throwable ): ResponseInterface
7373 {
7474 return new Response (Status::INTERNAL_SERVER_ERROR );
0 commit comments