true]); config(['admin.basic_auth_allowlist' => ['admin']]); }); test('гейт включён + нет REMOTE_USER → 403', function () { $this->getJson('/api/admin/tenants')->assertStatus(403); }); test('гейт включён + REMOTE_USER в allowlist → пройден (не 403)', function () { $this->withServerVariables(['REMOTE_USER' => 'admin']) ->getJson('/api/admin/tenants') ->assertOk(); }); test('гейт включён + REMOTE_USER не в allowlist → 403', function () { $this->withServerVariables(['REMOTE_USER' => 'eve']) ->getJson('/api/admin/tenants') ->assertStatus(403); }); test('гейт выключен (дефолт testing) + нет REMOTE_USER → не 403 (регрессия)', function () { config(['admin.basic_auth_gate' => false]); $this->getJson('/api/admin/tenants')->assertOk(); });