Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sweptsquash authored Feb 21, 2024
1 parent 05ee865 commit b54036e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/VeryBasicAuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Olssonm\VeryBasicAuth\Tests\Fixtures\CustomResponseHandler;

use function Pest\Laravel\get;
use function Pest\Laravel\withHeader;
use function Pest\Laravel\withHeaders;

test('basic auth filter is set', function () {
expect(in_array(VeryBasicAuth::class, $this->app->router->getMiddleware()))->toBeTrue();
Expand Down Expand Up @@ -36,7 +36,7 @@
});

test('request with incorrect credentials fails - text/html', function () {
$response = withHeader([
$response = withHeaders([
'PHP_AUTH_USER' => str_random(20),
'PHP_AUTH_PW' => str_random(20),
])->get('/');
Expand All @@ -48,7 +48,7 @@
});

test('request with incorrect credentials fails - json', function () {
$response = withHeader([
$response = withHeaders([
'PHP_AUTH_USER' => str_random(20),
'PHP_AUTH_PW' => str_random(20),
'Accept' => 'application/json',
Expand All @@ -66,7 +66,7 @@
test('request with incorrect credentials fails - view', function () {
config()->set('very_basic_auth.error_view', 'very_basic_auth::default');

$response = withHeader([
$response = withHeaders([
'PHP_AUTH_USER' => str_random(20),
'PHP_AUTH_PW' => str_random(20),
])->get('/');
Expand All @@ -79,7 +79,7 @@
});

test('request with correct credentials passes', function () {
$response = withHeader([
$response = withHeaders([
'PHP_AUTH_USER' => config('very_basic_auth.user'),
'PHP_AUTH_PW' => config('very_basic_auth.password'),
])->get('/');
Expand All @@ -103,7 +103,7 @@
});

test('request with incorrect inline credentials fails', function () {
$response = withHeader([
$response = withHeaders([
'PHP_AUTH_USER' => str_random(20),
'PHP_AUTH_PW' => str_random(20),
])->get('/inline');
Expand All @@ -113,7 +113,7 @@
});

test('request with correct inline credentials passes', function () {
$response = withHeader([
$response = withHeaders([
'PHP_AUTH_USER' => config('very_basic_auth.user'),
'PHP_AUTH_PW' => config('very_basic_auth.password'),
])->get('/inline');
Expand Down

0 comments on commit b54036e

Please sign in to comment.