Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint stub files with Pint #1313

Merged
merged 2 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions routes/inertia.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@
}

$authMiddleware = config('jetstream.guard')
? 'auth:'.config('jetstream.guard')
: 'auth';
? 'auth:'.config('jetstream.guard')
: 'auth';

$authSessionMiddleware = config('jetstream.auth_session', false)
? config('jetstream.auth_session')
: null;
? config('jetstream.auth_session')
: null;

Route::group(['middleware' => array_values(array_filter([$authMiddleware, $authSessionMiddleware]))], function () {
// User & Profile...
Route::get('/user/profile', [UserProfileController::class, 'show'])
->name('profile.show');
->name('profile.show');

Route::delete('/user/other-browser-sessions', [OtherBrowserSessionsController::class, 'destroy'])
->name('other-browser-sessions.destroy');
->name('other-browser-sessions.destroy');

Route::delete('/user/profile-photo', [ProfilePhotoController::class, 'destroy'])
->name('current-user-photo.destroy');
->name('current-user-photo.destroy');

if (Jetstream::hasAccountDeletionFeatures()) {
Route::delete('/user', [CurrentUserController::class, 'destroy'])
->name('current-user.destroy');
->name('current-user.destroy');
}

Route::group(['middleware' => 'verified'], function () {
Expand All @@ -66,11 +66,11 @@
Route::delete('/teams/{team}/members/{user}', [TeamMemberController::class, 'destroy'])->name('team-members.destroy');

Route::get('/team-invitations/{invitation}', [TeamInvitationController::class, 'accept'])
->middleware(['signed'])
->name('team-invitations.accept');
->middleware(['signed'])
->name('team-invitations.accept');

Route::delete('/team-invitations/{invitation}', [TeamInvitationController::class, 'destroy'])
->name('team-invitations.destroy');
->name('team-invitations.destroy');
}
});
});
Expand Down
12 changes: 6 additions & 6 deletions routes/livewire.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
}

$authMiddleware = config('jetstream.guard')
? 'auth:'.config('jetstream.guard')
: 'auth';
? 'auth:'.config('jetstream.guard')
: 'auth';

$authSessionMiddleware = config('jetstream.auth_session', false)
? config('jetstream.auth_session')
: null;
? config('jetstream.auth_session')
: null;

Route::group(['middleware' => array_values(array_filter([$authMiddleware, $authSessionMiddleware]))], function () {
// User & Profile...
Expand All @@ -41,8 +41,8 @@
Route::put('/current-team', [CurrentTeamController::class, 'update'])->name('current-team.update');

Route::get('/team-invitations/{invitation}', [TeamInvitationController::class, 'accept'])
->middleware(['signed'])
->name('team-invitations.accept');
->middleware(['signed'])
->name('team-invitations.accept');
}
});
});
Expand Down
16 changes: 8 additions & 8 deletions stubs/pest-tests/livewire/ApiTokenPermissionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
]);

Livewire::test(ApiTokenManager::class)
->set(['managingPermissionsFor' => $token])
->set(['updateApiTokenForm' => [
'permissions' => [
'delete',
'missing-permission',
],
]])
->call('updateApiToken');
->set(['managingPermissionsFor' => $token])
->set(['updateApiTokenForm' => [
'permissions' => [
'delete',
'missing-permission',
],
]])
->call('updateApiToken');

expect($user->fresh()->tokens->first())
->can('delete')->toBeTrue()
Expand Down
6 changes: 3 additions & 3 deletions stubs/pest-tests/livewire/BrowserSessionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$this->actingAs($user = User::factory()->create());

Livewire::test(LogoutOtherBrowserSessionsForm::class)
->set('password', 'password')
->call('logoutOtherBrowserSessions')
->assertSuccessful();
->set('password', 'password')
->call('logoutOtherBrowserSessions')
->assertSuccessful();
});
16 changes: 8 additions & 8 deletions stubs/pest-tests/livewire/CreateApiTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
}

Livewire::test(ApiTokenManager::class)
->set(['createApiTokenForm' => [
'name' => 'Test Token',
'permissions' => [
'read',
'update',
],
]])
->call('createApiToken');
->set(['createApiTokenForm' => [
'name' => 'Test Token',
'permissions' => [
'read',
'update',
],
]])
->call('createApiToken');

expect($user->fresh()->tokens)->toHaveCount(1);
expect($user->fresh()->tokens->first())
Expand Down
4 changes: 2 additions & 2 deletions stubs/pest-tests/livewire/CreateTeamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
$this->actingAs($user = User::factory()->withPersonalTeam()->create());

Livewire::test(CreateTeamForm::class)
->set(['state' => ['name' => 'Test Team']])
->call('createTeam');
->set(['state' => ['name' => 'Test Team']])
->call('createTeam');

expect($user->fresh()->ownedTeams)->toHaveCount(2);
expect($user->fresh()->ownedTeams()->latest('id')->first()->name)->toEqual('Test Team');
Expand Down
10 changes: 5 additions & 5 deletions stubs/pest-tests/livewire/DeleteAccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
$this->actingAs($user = User::factory()->create());

$component = Livewire::test(DeleteUserForm::class)
->set('password', 'password')
->call('deleteUser');
->set('password', 'password')
->call('deleteUser');

expect($user->fresh())->toBeNull();
})->skip(function () {
Expand All @@ -21,9 +21,9 @@
$this->actingAs($user = User::factory()->create());

Livewire::test(DeleteUserForm::class)
->set('password', 'wrong-password')
->call('deleteUser')
->assertHasErrors(['password']);
->set('password', 'wrong-password')
->call('deleteUser')
->assertHasErrors(['password']);

expect($user->fresh())->not->toBeNull();
})->skip(function () {
Expand Down
4 changes: 2 additions & 2 deletions stubs/pest-tests/livewire/DeleteApiTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
]);

Livewire::test(ApiTokenManager::class)
->set(['apiTokenIdBeingDeleted' => $token->id])
->call('deleteApiToken');
->set(['apiTokenIdBeingDeleted' => $token->id])
->call('deleteApiToken');

expect($user->fresh()->tokens)->toHaveCount(0);
})->skip(function () {
Expand Down
6 changes: 3 additions & 3 deletions stubs/pest-tests/livewire/DeleteTeamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
);

$component = Livewire::test(DeleteTeamForm::class, ['team' => $team->fresh()])
->call('deleteTeam');
->call('deleteTeam');

expect($team->fresh())->toBeNull();
expect($otherUser->fresh()->teams)->toHaveCount(0);
Expand All @@ -27,8 +27,8 @@
$this->actingAs($user = User::factory()->withPersonalTeam()->create());

$component = Livewire::test(DeleteTeamForm::class, ['team' => $user->currentTeam])
->call('deleteTeam')
->assertHasErrors(['team']);
->call('deleteTeam')
->assertHasErrors(['team']);

expect($user->currentTeam->fresh())->not->toBeNull();
});
16 changes: 8 additions & 8 deletions stubs/pest-tests/livewire/InviteTeamMemberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
$this->actingAs($user = User::factory()->withPersonalTeam()->create());

$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
->set('addTeamMemberForm', [
'email' => 'test@example.com',
'role' => 'admin',
])->call('addTeamMember');
->set('addTeamMemberForm', [
'email' => 'test@example.com',
'role' => 'admin',
])->call('addTeamMember');

Mail::assertSent(TeamInvitation::class);

Expand All @@ -32,10 +32,10 @@

// Add the team member...
$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
->set('addTeamMemberForm', [
'email' => 'test@example.com',
'role' => 'admin',
])->call('addTeamMember');
->set('addTeamMemberForm', [
'email' => 'test@example.com',
'role' => 'admin',
])->call('addTeamMember');

$invitationId = $user->currentTeam->fresh()->teamInvitations->first()->id;

Expand Down
6 changes: 3 additions & 3 deletions stubs/pest-tests/livewire/LeaveTeamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$this->actingAs($otherUser);

$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
->call('leaveTeam');
->call('leaveTeam');

expect($user->currentTeam->fresh()->users)->toHaveCount(0);
});
Expand All @@ -23,8 +23,8 @@
$this->actingAs($user = User::factory()->withPersonalTeam()->create());

$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
->call('leaveTeam')
->assertHasErrors(['team']);
->call('leaveTeam')
->assertHasErrors(['team']);

expect($user->currentTeam->fresh())->not->toBeNull();
});
4 changes: 2 additions & 2 deletions stubs/pest-tests/livewire/ProfileInformationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
$this->actingAs($user = User::factory()->create());

Livewire::test(UpdateProfileInformationForm::class)
->set('state', ['name' => 'Test Name', 'email' => 'test@example.com'])
->call('updateProfileInformation');
->set('state', ['name' => 'Test Name', 'email' => 'test@example.com'])
->call('updateProfileInformation');

expect($user->fresh())
->name->toEqual('Test Name')
Expand Down
10 changes: 5 additions & 5 deletions stubs/pest-tests/livewire/RemoveTeamMemberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
);

$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
->set('teamMemberIdBeingRemoved', $otherUser->id)
->call('removeTeamMember');
->set('teamMemberIdBeingRemoved', $otherUser->id)
->call('removeTeamMember');

expect($user->currentTeam->fresh()->users)->toHaveCount(0);
});
Expand All @@ -28,7 +28,7 @@
$this->actingAs($otherUser);

$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
->set('teamMemberIdBeingRemoved', $user->id)
->call('removeTeamMember')
->assertStatus(403);
->set('teamMemberIdBeingRemoved', $user->id)
->call('removeTeamMember')
->assertStatus(403);
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$this->withSession(['auth.password_confirmed_at' => time()]);

Livewire::test(TwoFactorAuthenticationForm::class)
->call('enableTwoFactorAuthentication');
->call('enableTwoFactorAuthentication');

$user = $user->fresh();

Expand All @@ -27,8 +27,8 @@
$this->withSession(['auth.password_confirmed_at' => time()]);

$component = Livewire::test(TwoFactorAuthenticationForm::class)
->call('enableTwoFactorAuthentication')
->call('regenerateRecoveryCodes');
->call('enableTwoFactorAuthentication')
->call('regenerateRecoveryCodes');

$user = $user->fresh();

Expand All @@ -46,7 +46,7 @@
$this->withSession(['auth.password_confirmed_at' => time()]);

$component = Livewire::test(TwoFactorAuthenticationForm::class)
->call('enableTwoFactorAuthentication');
->call('enableTwoFactorAuthentication');

$this->assertNotNull($user->fresh()->two_factor_secret);

Expand Down
40 changes: 20 additions & 20 deletions stubs/pest-tests/livewire/UpdatePasswordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
$this->actingAs($user = User::factory()->create());

Livewire::test(UpdatePasswordForm::class)
->set('state', [
'current_password' => 'password',
'password' => 'new-password',
'password_confirmation' => 'new-password',
])
->call('updatePassword');
->set('state', [
'current_password' => 'password',
'password' => 'new-password',
'password_confirmation' => 'new-password',
])
->call('updatePassword');

expect(Hash::check('new-password', $user->fresh()->password))->toBeTrue();
});
Expand All @@ -23,13 +23,13 @@
$this->actingAs($user = User::factory()->create());

Livewire::test(UpdatePasswordForm::class)
->set('state', [
'current_password' => 'wrong-password',
'password' => 'new-password',
'password_confirmation' => 'new-password',
])
->call('updatePassword')
->assertHasErrors(['current_password']);
->set('state', [
'current_password' => 'wrong-password',
'password' => 'new-password',
'password_confirmation' => 'new-password',
])
->call('updatePassword')
->assertHasErrors(['current_password']);

expect(Hash::check('password', $user->fresh()->password))->toBeTrue();
});
Expand All @@ -38,13 +38,13 @@
$this->actingAs($user = User::factory()->create());

Livewire::test(UpdatePasswordForm::class)
->set('state', [
'current_password' => 'password',
'password' => 'new-password',
'password_confirmation' => 'wrong-password',
])
->call('updatePassword')
->assertHasErrors(['password']);
->set('state', [
'current_password' => 'password',
'password' => 'new-password',
'password_confirmation' => 'wrong-password',
])
->call('updatePassword')
->assertHasErrors(['password']);

expect(Hash::check('password', $user->fresh()->password))->toBeTrue();
});
Loading