From 03cb35de40eebb939c67dac95663910b6390c734 Mon Sep 17 00:00:00 2001 From: Rod Elias Date: Wed, 19 Jun 2019 19:23:35 -0300 Subject: [PATCH 1/2] add unauthorized assertion --- http-tests.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/http-tests.md b/http-tests.md index 357511bf7b7..5c3d266eb65 100644 --- a/http-tests.md +++ b/http-tests.md @@ -294,6 +294,7 @@ Laravel provides a variety of custom assertion methods for your [PHPUnit](https: [assertSessionMissing](#assert-session-missing) [assertStatus](#assert-status) [assertSuccessful](#assert-successful) +[assertUnauthorized](#assert-unauthorized) [assertViewHas](#assert-view-has) [assertViewHasAll](#assert-view-has-all) [assertViewIs](#assert-view-is) @@ -553,6 +554,13 @@ Assert that the response has a successful status code: $response->assertSuccessful(); + +#### assertUnauthorized + +Assert that the response has an unauthorized status code: + + $response->assertUnauthorized(); + #### assertViewHas From 4b68ca4a20d0d4168013863434baee6543361473 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 20 Jun 2019 08:11:46 -0500 Subject: [PATCH 2/2] Update http-tests.md --- http-tests.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-tests.md b/http-tests.md index 5c3d266eb65..d830b4166fb 100644 --- a/http-tests.md +++ b/http-tests.md @@ -550,14 +550,14 @@ Assert that the response has a given code: #### assertSuccessful -Assert that the response has a successful status code: +Assert that the response has a successful (200) status code: $response->assertSuccessful(); #### assertUnauthorized -Assert that the response has an unauthorized status code: +Assert that the response has an unauthorized (401) status code: $response->assertUnauthorized();