From c087eb077d9b9d271f8e16af437cc8adcbce1495 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:42:28 +0000 Subject: [PATCH] chore: fmt --- tests/AppTest.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/AppTest.php b/tests/AppTest.php index 3add518..5242e83 100755 --- a/tests/AppTest.php +++ b/tests/AppTest.php @@ -665,13 +665,13 @@ public function testErrorHandlerFailure(): void $this->app ->error() ->inject('error') - ->action(function($error) { + ->action(function ($error) { throw new \Exception('Error handler failed'); }); $route = new Route('GET', '/path'); $route - ->action(function() { + ->action(function () { throw new \Exception('Route action failed'); }); @@ -691,13 +691,13 @@ public function testOptionsHandlerFailure(): void $this->app ->error() ->inject('error') - ->action(function($error) { + ->action(function ($error) { throw new \Exception('Options error handler failed'); }); // Set up an options handler that throws App::options() - ->action(function() { + ->action(function () { throw new \Exception('Options handler failed'); }); @@ -718,7 +718,7 @@ public function testNotFoundErrorHandlerFailure(): void // Set up error handler that throws for 404 cases $this->app ->error() - ->action(function() { + ->action(function () { throw new \Exception('404 error handler failed'); }); @@ -743,14 +743,14 @@ public function testGroupErrorHandlerFailure(): void $this->app ->error() ->groups(['api']) - ->action(function() { + ->action(function () { throw new \Exception('Group error handler failed'); }); $route = new Route('GET', '/api/test'); $route ->groups(['api']) - ->action(function() { + ->action(function () { throw new \Exception('Route action failed'); }); @@ -771,20 +771,20 @@ public function testErrorHandlerChaining(): void $this->app ->error() ->groups(['api']) - ->action(function() { + ->action(function () { throw new \Exception('First error handler failed'); }); $this->app ->error() - ->action(function() { + ->action(function () { throw new \Exception('Second error handler failed'); }); $route = new Route('GET', '/api/test'); $route ->groups(['api']) - ->action(function() { + ->action(function () { throw new \Exception('Original error'); }); @@ -794,7 +794,7 @@ public function testErrorHandlerChaining(): void } catch (\Exception $e) { $this->assertEquals('Error handler had an error: First error handler failed', $e->getMessage()); $this->assertEquals(500, $e->getCode()); - + // Verify the error chain $this->assertInstanceOf(\Exception::class, $e->getPrevious()); $this->assertEquals('First error handler failed', $e->getPrevious()->getMessage());