Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
loks0n committed Dec 10, 2024
1 parent b887c60 commit c087eb0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand All @@ -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');
});

Expand All @@ -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');
});

Expand All @@ -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');
});

Expand All @@ -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');
});

Expand All @@ -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());
Expand Down

0 comments on commit c087eb0

Please sign in to comment.