mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-19 01:46:03 +02:00
Apply Laravel Pint fixes
This commit is contained in:
@@ -2,15 +2,13 @@
|
||||
|
||||
namespace Tests\Feature\Http\Middlewares;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\FeatureTestCase;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
use Tests\FeatureTestCase;
|
||||
|
||||
class AuthenticateMiddlewareTest extends FeatureTestCase
|
||||
{
|
||||
|
||||
private const USER_NAME = 'John';
|
||||
|
||||
private const USER_EMAIL = 'john@example.com';
|
||||
|
||||
/**
|
||||
@@ -19,14 +17,13 @@ class AuthenticateMiddlewareTest extends FeatureTestCase
|
||||
public function test_it_always_authenticates_with_reverse_proxy_guard()
|
||||
{
|
||||
Config::set('auth.auth_proxy_headers.user', 'HTTP_REMOTE_USER');
|
||||
|
||||
|
||||
$this->app['auth']->shouldUse('reverse-proxy-guard');
|
||||
|
||||
$this->json('GET', '/api/v1/groups', [], ['HTTP_REMOTE_USER' => self::USER_NAME]);
|
||||
$this->assertAuthenticated('reverse-proxy-guard');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
@@ -38,8 +35,8 @@ class AuthenticateMiddlewareTest extends FeatureTestCase
|
||||
$this->app['auth']->shouldUse('reverse-proxy-guard');
|
||||
|
||||
$this->json('GET', '/api/v1/groups', [], [
|
||||
'HTTP_REMOTE_USER' => self::USER_NAME,
|
||||
'HTTP_REMOTE_EMAIL' => self::USER_EMAIL
|
||||
'HTTP_REMOTE_USER' => self::USER_NAME,
|
||||
'HTTP_REMOTE_EMAIL' => self::USER_EMAIL,
|
||||
]);
|
||||
$this->assertAuthenticated('reverse-proxy-guard');
|
||||
|
||||
@@ -48,7 +45,6 @@ class AuthenticateMiddlewareTest extends FeatureTestCase
|
||||
$this->assertEquals(self::USER_EMAIL, $user->email);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
@@ -59,7 +55,7 @@ class AuthenticateMiddlewareTest extends FeatureTestCase
|
||||
$this->app['auth']->shouldUse('reverse-proxy-guard');
|
||||
|
||||
$this->json('GET', '/api/v1/groups', [], [
|
||||
'HTTP_REMOTE_USER' => self::USER_NAME
|
||||
'HTTP_REMOTE_USER' => self::USER_NAME,
|
||||
]);
|
||||
$this->assertAuthenticated('reverse-proxy-guard');
|
||||
|
||||
@@ -67,7 +63,6 @@ class AuthenticateMiddlewareTest extends FeatureTestCase
|
||||
$this->assertEquals('fake.email@do.not.use', $user->email);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
@@ -79,12 +74,11 @@ class AuthenticateMiddlewareTest extends FeatureTestCase
|
||||
$this->app['auth']->shouldUse('reverse-proxy-guard');
|
||||
|
||||
$this->json('GET', '/api/v1/groups', [], [
|
||||
'HTTP_REMOTE_USER' => '',
|
||||
'HTTP_REMOTE_EMAIL' => ''
|
||||
'HTTP_REMOTE_USER' => '',
|
||||
'HTTP_REMOTE_EMAIL' => '',
|
||||
])->assertStatus(407);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
@@ -95,5 +89,4 @@ class AuthenticateMiddlewareTest extends FeatureTestCase
|
||||
$this->json('GET', '/api/v1/groups', [], [])
|
||||
->assertStatus(407);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user