The Laravel 13 upgrade pulled Pint 1.27.1 to 1.29.3, which changed the laravel preset's default rules. composer lint and the CI lint job fail without this, so it is required rather than cosmetic. Formatting only, applied by `vendor/bin/pint`. The rules that fired were fully_qualified_strict_types, ordered_imports, single_blank_line_at_eof, unary_operator_spaces, not_operator_with_successor_space, braces_position, single_line_empty_body, single_line_after_imports and no_extra_blank_lines. Kept separate from the upgrade commit to keep that diff reviewable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
33 lines
925 B
PHP
33 lines
925 B
PHP
<?php
|
|
|
|
use App\Models\User;
|
|
use Laravel\Fortify\Features;
|
|
|
|
test('two factor challenge redirects to login when not authenticated', function () {
|
|
if (! Features::canManageTwoFactorAuthentication()) {
|
|
$this->markTestSkipped('Two-factor authentication is not enabled.');
|
|
}
|
|
|
|
$response = $this->get(route('two-factor.login'));
|
|
|
|
$response->assertRedirect(route('login'));
|
|
});
|
|
|
|
test('two factor challenge can be rendered', function () {
|
|
if (! Features::canManageTwoFactorAuthentication()) {
|
|
$this->markTestSkipped('Two-factor authentication is not enabled.');
|
|
}
|
|
|
|
Features::twoFactorAuthentication([
|
|
'confirm' => true,
|
|
'confirmPassword' => true,
|
|
]);
|
|
|
|
$user = User::factory()->withTwoFactor()->create();
|
|
|
|
$this->post(route('login.store'), [
|
|
'email' => $user->email,
|
|
'password' => 'password',
|
|
])->assertRedirect(route('two-factor.login'));
|
|
});
|