Skip to content

Commit 108e2ce

Browse files
[4.x] Remove Unreachable return in PHPUnit test stubs (#1423)
* Update RegistrationTest.php * Update PasswordResetTest.php * Update EmailVerificationTest.php * Update ApiTokenPermissionsTest.php * Update CreateApiTokenTest.php * Update DeleteAccountTest.php * Update DeleteApiTokenTest.php * Update InviteTeamMemberTest.php * Update TwoFactorAuthenticationSettingsTest.php * Update TwoFactorAuthenticationSettingsTest.php * Update ApiTokenPermissionsTest.php * Update CreateApiTokenTest.php * Update DeleteAccountTest.php * Update DeleteApiTokenTest.php * Update InviteTeamMemberTest.php * Update TwoFactorAuthenticationSettingsTest.php
1 parent 9173207 commit 108e2ce

15 files changed

+0
-60
lines changed

stubs/tests/EmailVerificationTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ public function test_email_verification_screen_can_be_rendered(): void
1919
{
2020
if (! Features::enabled(Features::emailVerification())) {
2121
$this->markTestSkipped('Email verification not enabled.');
22-
23-
return;
2422
}
2523

2624
$user = User::factory()->withPersonalTeam()->unverified()->create();
@@ -34,8 +32,6 @@ public function test_email_can_be_verified(): void
3432
{
3533
if (! Features::enabled(Features::emailVerification())) {
3634
$this->markTestSkipped('Email verification not enabled.');
37-
38-
return;
3935
}
4036

4137
Event::fake();
@@ -60,8 +56,6 @@ public function test_email_can_not_verified_with_invalid_hash(): void
6056
{
6157
if (! Features::enabled(Features::emailVerification())) {
6258
$this->markTestSkipped('Email verification not enabled.');
63-
64-
return;
6559
}
6660

6761
$user = User::factory()->unverified()->create();

stubs/tests/PasswordResetTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ public function test_reset_password_link_screen_can_be_rendered(): void
1717
{
1818
if (! Features::enabled(Features::resetPasswords())) {
1919
$this->markTestSkipped('Password updates are not enabled.');
20-
21-
return;
2220
}
2321

2422
$response = $this->get('/forgot-password');
@@ -30,8 +28,6 @@ public function test_reset_password_link_can_be_requested(): void
3028
{
3129
if (! Features::enabled(Features::resetPasswords())) {
3230
$this->markTestSkipped('Password updates are not enabled.');
33-
34-
return;
3531
}
3632

3733
Notification::fake();
@@ -49,8 +45,6 @@ public function test_reset_password_screen_can_be_rendered(): void
4945
{
5046
if (! Features::enabled(Features::resetPasswords())) {
5147
$this->markTestSkipped('Password updates are not enabled.');
52-
53-
return;
5448
}
5549

5650
Notification::fake();
@@ -74,8 +68,6 @@ public function test_password_can_be_reset_with_valid_token(): void
7468
{
7569
if (! Features::enabled(Features::resetPasswords())) {
7670
$this->markTestSkipped('Password updates are not enabled.');
77-
78-
return;
7971
}
8072

8173
Notification::fake();

stubs/tests/RegistrationTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ public function test_registration_screen_can_be_rendered(): void
1616
{
1717
if (! Features::enabled(Features::registration())) {
1818
$this->markTestSkipped('Registration support is not enabled.');
19-
20-
return;
2119
}
2220

2321
$response = $this->get('/register');
@@ -29,8 +27,6 @@ public function test_registration_screen_cannot_be_rendered_if_support_is_disabl
2927
{
3028
if (Features::enabled(Features::registration())) {
3129
$this->markTestSkipped('Registration support is enabled.');
32-
33-
return;
3430
}
3531

3632
$response = $this->get('/register');
@@ -42,8 +38,6 @@ public function test_new_users_can_register(): void
4238
{
4339
if (! Features::enabled(Features::registration())) {
4440
$this->markTestSkipped('Registration support is not enabled.');
45-
46-
return;
4741
}
4842

4943
$response = $this->post('/register', [

stubs/tests/inertia/ApiTokenPermissionsTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ public function test_api_token_permissions_can_be_updated(): void
1616
{
1717
if (! Features::hasApiFeatures()) {
1818
$this->markTestSkipped('API support is not enabled.');
19-
20-
return;
2119
}
2220

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

stubs/tests/inertia/CreateApiTokenTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ public function test_api_tokens_can_be_created(): void
1515
{
1616
if (! Features::hasApiFeatures()) {
1717
$this->markTestSkipped('API support is not enabled.');
18-
19-
return;
2018
}
2119

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

stubs/tests/inertia/DeleteAccountTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ public function test_user_accounts_can_be_deleted(): void
1515
{
1616
if (! Features::hasAccountDeletionFeatures()) {
1717
$this->markTestSkipped('Account deletion is not enabled.');
18-
19-
return;
2018
}
2119

2220
$this->actingAs($user = User::factory()->create());
@@ -32,8 +30,6 @@ public function test_correct_password_must_be_provided_before_account_can_be_del
3230
{
3331
if (! Features::hasAccountDeletionFeatures()) {
3432
$this->markTestSkipped('Account deletion is not enabled.');
35-
36-
return;
3733
}
3834

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

stubs/tests/inertia/DeleteApiTokenTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ public function test_api_tokens_can_be_deleted(): void
1616
{
1717
if (! Features::hasApiFeatures()) {
1818
$this->markTestSkipped('API support is not enabled.');
19-
20-
return;
2119
}
2220

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

stubs/tests/inertia/InviteTeamMemberTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ public function test_team_members_can_be_invited_to_team(): void
1717
{
1818
if (! Features::sendsTeamInvitations()) {
1919
$this->markTestSkipped('Team invitations not enabled.');
20-
21-
return;
2220
}
2321

2422
Mail::fake();
@@ -39,8 +37,6 @@ public function test_team_member_invitations_can_be_cancelled(): void
3937
{
4038
if (! Features::sendsTeamInvitations()) {
4139
$this->markTestSkipped('Team invitations not enabled.');
42-
43-
return;
4440
}
4541

4642
Mail::fake();

stubs/tests/inertia/TwoFactorAuthenticationSettingsTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ public function test_two_factor_authentication_can_be_enabled(): void
1515
{
1616
if (! Features::canManageTwoFactorAuthentication()) {
1717
$this->markTestSkipped('Two factor authentication is not enabled.');
18-
19-
return;
2018
}
2119

2220
$this->actingAs($user = User::factory()->create());
@@ -33,8 +31,6 @@ public function test_recovery_codes_can_be_regenerated(): void
3331
{
3432
if (! Features::canManageTwoFactorAuthentication()) {
3533
$this->markTestSkipped('Two factor authentication is not enabled.');
36-
37-
return;
3834
}
3935

4036
$this->actingAs($user = User::factory()->create());
@@ -56,8 +52,6 @@ public function test_two_factor_authentication_can_be_disabled(): void
5652
{
5753
if (! Features::canManageTwoFactorAuthentication()) {
5854
$this->markTestSkipped('Two factor authentication is not enabled.');
59-
60-
return;
6155
}
6256

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

stubs/tests/livewire/ApiTokenPermissionsTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ public function test_api_token_permissions_can_be_updated(): void
1818
{
1919
if (! Features::hasApiFeatures()) {
2020
$this->markTestSkipped('API support is not enabled.');
21-
22-
return;
2321
}
2422

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

0 commit comments

Comments
 (0)