refactor: apply rector
Some checks are pending
tests / ci (push) Waiting to run

This commit is contained in:
Benjamin Nussbaum 2025-09-24 20:31:32 +02:00
parent c67a182cf2
commit b4b6286172
89 changed files with 672 additions and 666 deletions

View file

@ -5,13 +5,13 @@ use Livewire\Volt\Volt as LivewireVolt;
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
test('login screen can be rendered', function () {
test('login screen can be rendered', function (): void {
$response = $this->get('/login');
$response->assertStatus(200);
});
test('users can authenticate using the login screen', function () {
test('users can authenticate using the login screen', function (): void {
$user = User::factory()->create();
$response = LivewireVolt::test('auth.login')
@ -26,7 +26,7 @@ test('users can authenticate using the login screen', function () {
$this->assertAuthenticated();
});
test('users can not authenticate with invalid password', function () {
test('users can not authenticate with invalid password', function (): void {
$user = User::factory()->create();
$this->post('/login', [
@ -37,7 +37,7 @@ test('users can not authenticate with invalid password', function () {
$this->assertGuest();
});
test('users can logout', function () {
test('users can logout', function (): void {
$user = User::factory()->create();
$response = $this->actingAs($user)->post('/logout');

View file

@ -7,7 +7,7 @@ use Illuminate\Support\Facades\URL;
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
test('email verification screen can be rendered', function () {
test('email verification screen can be rendered', function (): void {
$user = User::factory()->unverified()->create();
$response = $this->actingAs($user)->get('/verify-email');
@ -15,7 +15,7 @@ test('email verification screen can be rendered', function () {
$response->assertStatus(200);
});
test('email can be verified', function () {
test('email can be verified', function (): void {
$user = User::factory()->unverified()->create();
Event::fake();
@ -23,7 +23,7 @@ test('email can be verified', function () {
$verificationUrl = URL::temporarySignedRoute(
'verification.verify',
now()->addMinutes(60),
['id' => $user->id, 'hash' => sha1($user->email)]
['id' => $user->id, 'hash' => sha1((string) $user->email)]
);
$response = $this->actingAs($user)->get($verificationUrl);
@ -34,7 +34,7 @@ test('email can be verified', function () {
$response->assertRedirect(route('dashboard', absolute: false).'?verified=1');
});
test('email is not verified with invalid hash', function () {
test('email is not verified with invalid hash', function (): void {
$user = User::factory()->unverified()->create();
$verificationUrl = URL::temporarySignedRoute(

View file

@ -5,7 +5,7 @@ use Livewire\Volt\Volt;
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
test('confirm password screen can be rendered', function () {
test('confirm password screen can be rendered', function (): void {
$user = User::factory()->create();
$response = $this->actingAs($user)->get('/confirm-password');
@ -13,7 +13,7 @@ test('confirm password screen can be rendered', function () {
$response->assertStatus(200);
});
test('password can be confirmed', function () {
test('password can be confirmed', function (): void {
$user = User::factory()->create();
$this->actingAs($user);
@ -27,7 +27,7 @@ test('password can be confirmed', function () {
->assertRedirect(route('dashboard', absolute: false));
});
test('password is not confirmed with invalid password', function () {
test('password is not confirmed with invalid password', function (): void {
$user = User::factory()->create();
$this->actingAs($user);

View file

@ -7,13 +7,13 @@ use Livewire\Volt\Volt;
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
test('reset password link screen can be rendered', function () {
test('reset password link screen can be rendered', function (): void {
$response = $this->get('/forgot-password');
$response->assertStatus(200);
});
test('reset password link can be requested', function () {
test('reset password link can be requested', function (): void {
Notification::fake();
$user = User::factory()->create();
@ -25,7 +25,7 @@ test('reset password link can be requested', function () {
Notification::assertSentTo($user, ResetPassword::class);
});
test('reset password screen can be rendered', function () {
test('reset password screen can be rendered', function (): void {
Notification::fake();
$user = User::factory()->create();
@ -34,7 +34,7 @@ test('reset password screen can be rendered', function () {
->set('email', $user->email)
->call('sendPasswordResetLink');
Notification::assertSentTo($user, ResetPassword::class, function ($notification) {
Notification::assertSentTo($user, ResetPassword::class, function ($notification): true {
$response = $this->get('/reset-password/'.$notification->token);
$response->assertStatus(200);
@ -43,7 +43,7 @@ test('reset password screen can be rendered', function () {
});
});
test('password can be reset with valid token', function () {
test('password can be reset with valid token', function (): void {
Notification::fake();
$user = User::factory()->create();
@ -52,7 +52,7 @@ test('password can be reset with valid token', function () {
->set('email', $user->email)
->call('sendPasswordResetLink');
Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user) {
Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user): true {
$response = Volt::test('auth.reset-password', ['token' => $notification->token])
->set('email', $user->email)
->set('password', 'password')

View file

@ -4,13 +4,13 @@ use Livewire\Volt\Volt;
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
test('registration screen can be rendered', function () {
test('registration screen can be rendered', function (): void {
$response = $this->get('/register');
$response->assertStatus(200);
});
test('new users can register', function () {
test('new users can register', function (): void {
$response = Volt::test('auth.register')
->set('name', 'Test User')
->set('email', 'test@example.com')