Skip to content

Commit 4a8e37b

Browse files
committed
test for php error catched
1 parent 5083008 commit 4a8e37b

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

spec/Integration/IntegrationViaErrorPreviewActionMiddlewareShownErrorSpec.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
$this->app->run($serverRequest);
103103
} catch (\Throwable $t) {
104104
expect($t)->toBeAnInstanceOf(\Throwable::class);
105+
expect($t->getMessage())->toContain('E_NOTICE');
105106
}
106107

107108
});

spec/Integration/IntegrationViaErrorPreviewControllerForErrorShownSpec.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
expect($content)->toBe('');
5555
} catch (\Throwable $t) {
5656
expect($t)->toBeAnInstanceOf(\Exception::class);
57+
expect($t->getMessage())->toContain('E_NOTICE');
5758
}
5859
});
5960
});

src/Controller/ErrorPreviewController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ public function errorAction()
1515
{
1616
$array = [];
1717
$array[1]; // E_NOTICE
18+
19+
return $this->getResponse();
1820
}
1921
}

0 commit comments

Comments
 (0)