From 6cb3517f34e90da3e1b348e15ba2bab52a101395 Mon Sep 17 00:00:00 2001 From: markhuot Date: Wed, 29 Nov 2023 00:14:41 -0500 Subject: [PATCH 1/2] swapping exception handling so you get better error messages by default --- src/test/WithExceptionHandling.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/WithExceptionHandling.php b/src/test/WithExceptionHandling.php index f4195d0..bb95393 100644 --- a/src/test/WithExceptionHandling.php +++ b/src/test/WithExceptionHandling.php @@ -4,7 +4,7 @@ trait WithExceptionHandling { - protected bool $withExceptionHandling = true; + protected bool $withExceptionHandling = false; public function withExceptionHandling(): self { From db549ea7b9321437ff3d0626fc8ceae40d1ecc54 Mon Sep 17 00:00:00 2001 From: markhuot Date: Wed, 29 Nov 2023 00:22:29 -0500 Subject: [PATCH 2/2] fixing tests that need exception handling because we're asserting on the response --- tests/FormFieldTest.php | 4 +++- tests/ResponseTest.php | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/FormFieldTest.php b/tests/FormFieldTest.php index 06383a2..e9c773c 100644 --- a/tests/FormFieldTest.php +++ b/tests/FormFieldTest.php @@ -42,6 +42,7 @@ it('can fill fields with array style names') + ->withExceptionHandling() ->get('/page-with-multiple-forms') ->assertOk() ->form('#form3') @@ -58,7 +59,8 @@ it('does not see disabled fields', function () { - $this->get('/page-with-multiple-forms') + $this->withExceptionHandling() + ->get('/page-with-multiple-forms') ->assertOk() ->form('#form4') ->submit() diff --git a/tests/ResponseTest.php b/tests/ResponseTest.php index 8f96598..a6f013c 100644 --- a/tests/ResponseTest.php +++ b/tests/ResponseTest.php @@ -176,6 +176,7 @@ ->assertLocationPath('/'); it('returns HTML for exceptions') + ->withExceptionHandling() ->get('/responses/500') ->assertStatus(500);