Skip to content

Commit cddcbb1

Browse files
committed
Remove unused variables form test stubs
1 parent b360d9f commit cddcbb1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+62
-62
lines changed

stubs/pest-tests/inertia/ApiTokenPermissionsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'abilities' => ['create', 'read'],
1818
]);
1919

20-
$response = $this->put('/user/api-tokens/'.$token->id, [
20+
$this->put('/user/api-tokens/'.$token->id, [
2121
'name' => $token->name,
2222
'permissions' => [
2323
'delete',

stubs/pest-tests/inertia/BrowserSessionsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use App\Models\User;
44

55
test('other browser sessions can be logged out', function () {
6-
$this->actingAs($user = User::factory()->create());
6+
$this->actingAs(User::factory()->create());
77

88
$response = $this->delete('/user/other-browser-sessions', [
99
'password' => 'password',

stubs/pest-tests/inertia/CreateApiTokenTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
$this->actingAs($user = User::factory()->create());
1111
}
1212

13-
$response = $this->post('/user/api-tokens', [
13+
$this->post('/user/api-tokens', [
1414
'name' => 'Test Token',
1515
'permissions' => [
1616
'read',

stubs/pest-tests/inertia/CreateTeamTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
test('teams can be created', function () {
66
$this->actingAs($user = User::factory()->withPersonalTeam()->create());
77

8-
$response = $this->post('/teams', [
8+
$this->post('/teams', [
99
'name' => 'Test Team',
1010
]);
1111

stubs/pest-tests/inertia/DeleteAccountTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
test('user accounts can be deleted', function () {
77
$this->actingAs($user = User::factory()->create());
88

9-
$response = $this->delete('/user', [
9+
$this->delete('/user', [
1010
'password' => 'password',
1111
]);
1212

@@ -18,7 +18,7 @@
1818
test('correct password must be provided before account can be deleted', function () {
1919
$this->actingAs($user = User::factory()->create());
2020

21-
$response = $this->delete('/user', [
21+
$this->delete('/user', [
2222
'password' => 'wrong-password',
2323
]);
2424

stubs/pest-tests/inertia/DeleteApiTokenTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'abilities' => ['create', 'read'],
1818
]);
1919

20-
$response = $this->delete('/user/api-tokens/'.$token->id);
20+
$this->delete('/user/api-tokens/'.$token->id);
2121

2222
expect($user->fresh()->tokens)->toHaveCount(0);
2323
})->skip(function () {

stubs/pest-tests/inertia/DeleteTeamTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
$otherUser = User::factory()->create(), ['role' => 'test-role']
1515
);
1616

17-
$response = $this->delete('/teams/'.$team->id);
17+
$this->delete('/teams/'.$team->id);
1818

1919
expect($team->fresh())->toBeNull();
2020
expect($otherUser->fresh()->teams)->toHaveCount(0);
@@ -23,7 +23,7 @@
2323
test('personal teams cant be deleted', function () {
2424
$this->actingAs($user = User::factory()->withPersonalTeam()->create());
2525

26-
$response = $this->delete('/teams/'.$user->currentTeam->id);
26+
$this->delete('/teams/'.$user->currentTeam->id);
2727

2828
expect($user->currentTeam->fresh())->not->toBeNull();
2929
});

stubs/pest-tests/inertia/InviteTeamMemberTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
$this->actingAs($user = User::factory()->withPersonalTeam()->create());
1212

13-
$response = $this->post('/teams/'.$user->currentTeam->id.'/members', [
13+
$this->post('/teams/'.$user->currentTeam->id.'/members', [
1414
'email' => '[email protected]',
1515
'role' => 'admin',
1616
]);
@@ -32,7 +32,7 @@
3232
'role' => 'admin',
3333
]);
3434

35-
$response = $this->delete('/team-invitations/'.$invitation->id);
35+
$this->delete('/team-invitations/'.$invitation->id);
3636

3737
expect($user->currentTeam->fresh()->teamInvitations)->toHaveCount(0);
3838
})->skip(function () {

stubs/pest-tests/inertia/LeaveTeamTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
$this->actingAs($otherUser);
1313

14-
$response = $this->delete('/teams/'.$user->currentTeam->id.'/members/'.$otherUser->id);
14+
$this->delete('/teams/'.$user->currentTeam->id.'/members/'.$otherUser->id);
1515

1616
expect($user->currentTeam->fresh()->users)->toHaveCount(0);
1717
});

stubs/pest-tests/inertia/ProfileInformationTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
test('profile information can be updated', function () {
66
$this->actingAs($user = User::factory()->create());
77

8-
$response = $this->put('/user/profile-information', [
8+
$this->put('/user/profile-information', [
99
'name' => 'Test Name',
1010
'email' => '[email protected]',
1111
]);

stubs/pest-tests/inertia/RemoveTeamMemberTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
$otherUser = User::factory()->create(), ['role' => 'admin']
1010
);
1111

12-
$response = $this->delete('/teams/'.$user->currentTeam->id.'/members/'.$otherUser->id);
12+
$this->delete('/teams/'.$user->currentTeam->id.'/members/'.$otherUser->id);
1313

1414
expect($user->currentTeam->fresh()->users)->toHaveCount(0);
1515
});

stubs/pest-tests/inertia/TwoFactorAuthenticationSettingsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
$this->withSession(['auth.password_confirmed_at' => time()]);
1010

11-
$response = $this->post('/user/two-factor-authentication');
11+
$this->post('/user/two-factor-authentication');
1212

1313
expect($user->fresh()->two_factor_secret)->not->toBeNull();
1414
expect($user->fresh()->recoveryCodes())->toHaveCount(8);

stubs/pest-tests/inertia/UpdatePasswordTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
test('password can be updated', function () {
77
$this->actingAs($user = User::factory()->create());
88

9-
$response = $this->put('/user/password', [
9+
$this->put('/user/password', [
1010
'current_password' => 'password',
1111
'password' => 'new-password',
1212
'password_confirmation' => 'new-password',

stubs/pest-tests/inertia/UpdateTeamMemberRoleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
$otherUser = User::factory()->create(), ['role' => 'admin']
1010
);
1111

12-
$response = $this->put('/teams/'.$user->currentTeam->id.'/members/'.$otherUser->id, [
12+
$this->put('/teams/'.$user->currentTeam->id.'/members/'.$otherUser->id, [
1313
'role' => 'editor',
1414
]);
1515

@@ -27,7 +27,7 @@
2727

2828
$this->actingAs($otherUser);
2929

30-
$response = $this->put('/teams/'.$user->currentTeam->id.'/members/'.$otherUser->id, [
30+
$this->put('/teams/'.$user->currentTeam->id.'/members/'.$otherUser->id, [
3131
'role' => 'editor',
3232
]);
3333

stubs/pest-tests/inertia/UpdateTeamNameTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
test('team names can be updated', function () {
66
$this->actingAs($user = User::factory()->withPersonalTeam()->create());
77

8-
$response = $this->put('/teams/'.$user->currentTeam->id, [
8+
$this->put('/teams/'.$user->currentTeam->id, [
99
'name' => 'Test Team',
1010
]);
1111

stubs/pest-tests/livewire/BrowserSessionsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Livewire\Livewire;
66

77
test('other browser sessions can be logged out', function () {
8-
$this->actingAs($user = User::factory()->create());
8+
$this->actingAs(User::factory()->create());
99

1010
Livewire::test(LogoutOtherBrowserSessionsForm::class)
1111
->set('password', 'password')

stubs/pest-tests/livewire/DeleteAccountTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
test('user accounts can be deleted', function () {
99
$this->actingAs($user = User::factory()->create());
1010

11-
$component = Livewire::test(DeleteUserForm::class)
11+
Livewire::test(DeleteUserForm::class)
1212
->set('password', 'password')
1313
->call('deleteUser');
1414

stubs/pest-tests/livewire/DeleteTeamTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$otherUser = User::factory()->create(), ['role' => 'test-role']
1717
);
1818

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

2222
expect($team->fresh())->toBeNull();
@@ -26,7 +26,7 @@
2626
test('personal teams cant be deleted', function () {
2727
$this->actingAs($user = User::factory()->withPersonalTeam()->create());
2828

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

stubs/pest-tests/livewire/InviteTeamMemberTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
$this->actingAs($user = User::factory()->withPersonalTeam()->create());
1414

15-
$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
15+
Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
1616
->set('addTeamMemberForm', [
1717
'email' => '[email protected]',
1818
'role' => 'admin',

stubs/pest-tests/livewire/LeaveTeamTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
$this->actingAs($otherUser);
1515

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

1919
expect($user->currentTeam->fresh()->users)->toHaveCount(0);
@@ -22,7 +22,7 @@
2222
test('team owners cant leave their own team', function () {
2323
$this->actingAs($user = User::factory()->withPersonalTeam()->create());
2424

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

stubs/pest-tests/livewire/RemoveTeamMemberTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
$otherUser = User::factory()->create(), ['role' => 'admin']
1212
);
1313

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

@@ -27,7 +27,7 @@
2727

2828
$this->actingAs($otherUser);
2929

30-
$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
30+
Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
3131
->set('teamMemberIdBeingRemoved', $user->id)
3232
->call('removeTeamMember')
3333
->assertStatus(403);

stubs/pest-tests/livewire/UpdateTeamMemberRoleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
$otherUser = User::factory()->create(), ['role' => 'admin']
1212
);
1313

14-
$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
14+
Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
1515
->set('managingRoleFor', $otherUser)
1616
->set('currentRole', 'editor')
1717
->call('updateRole');
@@ -30,7 +30,7 @@
3030

3131
$this->actingAs($otherUser);
3232

33-
$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
33+
Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam])
3434
->set('managingRoleFor', $otherUser)
3535
->set('currentRole', 'editor')
3636
->call('updateRole')

stubs/tests/PasswordResetTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function test_reset_password_link_can_be_requested(): void
3434

3535
$user = User::factory()->create();
3636

37-
$response = $this->post('/forgot-password', [
37+
$this->post('/forgot-password', [
3838
'email' => $user->email,
3939
]);
4040

@@ -51,7 +51,7 @@ public function test_reset_password_screen_can_be_rendered(): void
5151

5252
$user = User::factory()->create();
5353

54-
$response = $this->post('/forgot-password', [
54+
$this->post('/forgot-password', [
5555
'email' => $user->email,
5656
]);
5757

@@ -74,7 +74,7 @@ public function test_password_can_be_reset_with_valid_token(): void
7474

7575
$user = User::factory()->create();
7676

77-
$response = $this->post('/forgot-password', [
77+
$this->post('/forgot-password', [
7878
'email' => $user->email,
7979
]);
8080

stubs/tests/inertia/ApiTokenPermissionsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function test_api_token_permissions_can_be_updated(): void
2626
'abilities' => ['create', 'read'],
2727
]);
2828

29-
$response = $this->put('/user/api-tokens/'.$token->id, [
29+
$this->put('/user/api-tokens/'.$token->id, [
3030
'name' => $token->name,
3131
'permissions' => [
3232
'delete',

stubs/tests/inertia/BrowserSessionsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class BrowserSessionsTest extends TestCase
1212

1313
public function test_other_browser_sessions_can_be_logged_out(): void
1414
{
15-
$this->actingAs($user = User::factory()->create());
15+
$this->actingAs(User::factory()->create());
1616

1717
$response = $this->delete('/user/other-browser-sessions', [
1818
'password' => 'password',

stubs/tests/inertia/CreateApiTokenTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function test_api_tokens_can_be_created(): void
1919

2020
$this->actingAs($user = User::factory()->withPersonalTeam()->create());
2121

22-
$response = $this->post('/user/api-tokens', [
22+
$this->post('/user/api-tokens', [
2323
'name' => 'Test Token',
2424
'permissions' => [
2525
'read',

stubs/tests/inertia/CreateTeamTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function test_teams_can_be_created(): void
1414
{
1515
$this->actingAs($user = User::factory()->withPersonalTeam()->create());
1616

17-
$response = $this->post('/teams', [
17+
$this->post('/teams', [
1818
'name' => 'Test Team',
1919
]);
2020

stubs/tests/inertia/DeleteAccountTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function test_user_accounts_can_be_deleted(): void
1919

2020
$this->actingAs($user = User::factory()->create());
2121

22-
$response = $this->delete('/user', [
22+
$this->delete('/user', [
2323
'password' => 'password',
2424
]);
2525

@@ -34,7 +34,7 @@ public function test_correct_password_must_be_provided_before_account_can_be_del
3434

3535
$this->actingAs($user = User::factory()->create());
3636

37-
$response = $this->delete('/user', [
37+
$this->delete('/user', [
3838
'password' => 'wrong-password',
3939
]);
4040

stubs/tests/inertia/DeleteApiTokenTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function test_api_tokens_can_be_deleted(): void
2626
'abilities' => ['create', 'read'],
2727
]);
2828

29-
$response = $this->delete('/user/api-tokens/'.$token->id);
29+
$this->delete('/user/api-tokens/'.$token->id);
3030

3131
$this->assertCount(0, $user->fresh()->tokens);
3232
}

stubs/tests/inertia/DeleteTeamTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function test_teams_can_be_deleted(): void
2323
$otherUser = User::factory()->create(), ['role' => 'test-role']
2424
);
2525

26-
$response = $this->delete('/teams/'.$team->id);
26+
$this->delete('/teams/'.$team->id);
2727

2828
$this->assertNull($team->fresh());
2929
$this->assertCount(0, $otherUser->fresh()->teams);
@@ -33,7 +33,7 @@ public function test_personal_teams_cant_be_deleted(): void
3333
{
3434
$this->actingAs($user = User::factory()->withPersonalTeam()->create());
3535

36-
$response = $this->delete('/teams/'.$user->currentTeam->id);
36+
$this->delete('/teams/'.$user->currentTeam->id);
3737

3838
$this->assertNotNull($user->currentTeam->fresh());
3939
}

stubs/tests/inertia/InviteTeamMemberTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function test_team_members_can_be_invited_to_team(): void
2323

2424
$this->actingAs($user = User::factory()->withPersonalTeam()->create());
2525

26-
$response = $this->post('/teams/'.$user->currentTeam->id.'/members', [
26+
$this->post('/teams/'.$user->currentTeam->id.'/members', [
2727
'email' => '[email protected]',
2828
'role' => 'admin',
2929
]);
@@ -48,7 +48,7 @@ public function test_team_member_invitations_can_be_cancelled(): void
4848
'role' => 'admin',
4949
]);
5050

51-
$response = $this->delete('/team-invitations/'.$invitation->id);
51+
$this->delete('/team-invitations/'.$invitation->id);
5252

5353
$this->assertCount(0, $user->currentTeam->fresh()->teamInvitations);
5454
}

0 commit comments

Comments
 (0)