Skip to content

[4.x] Remove Unreachable return in PHPUnit test stubs #1423

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

Merged
merged 16 commits into from
Dec 26, 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
6 changes: 0 additions & 6 deletions stubs/tests/EmailVerificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ public function test_email_verification_screen_can_be_rendered(): void
{
if (! Features::enabled(Features::emailVerification())) {
$this->markTestSkipped('Email verification not enabled.');

return;
}

$user = User::factory()->withPersonalTeam()->unverified()->create();
Expand All @@ -34,8 +32,6 @@ public function test_email_can_be_verified(): void
{
if (! Features::enabled(Features::emailVerification())) {
$this->markTestSkipped('Email verification not enabled.');

return;
}

Event::fake();
Expand All @@ -60,8 +56,6 @@ public function test_email_can_not_verified_with_invalid_hash(): void
{
if (! Features::enabled(Features::emailVerification())) {
$this->markTestSkipped('Email verification not enabled.');

return;
}

$user = User::factory()->unverified()->create();
Expand Down
8 changes: 0 additions & 8 deletions stubs/tests/PasswordResetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public function test_reset_password_link_screen_can_be_rendered(): void
{
if (! Features::enabled(Features::resetPasswords())) {
$this->markTestSkipped('Password updates are not enabled.');

return;
}

$response = $this->get('/forgot-password');
Expand All @@ -30,8 +28,6 @@ public function test_reset_password_link_can_be_requested(): void
{
if (! Features::enabled(Features::resetPasswords())) {
$this->markTestSkipped('Password updates are not enabled.');

return;
}

Notification::fake();
Expand All @@ -49,8 +45,6 @@ public function test_reset_password_screen_can_be_rendered(): void
{
if (! Features::enabled(Features::resetPasswords())) {
$this->markTestSkipped('Password updates are not enabled.');

return;
}

Notification::fake();
Expand All @@ -74,8 +68,6 @@ public function test_password_can_be_reset_with_valid_token(): void
{
if (! Features::enabled(Features::resetPasswords())) {
$this->markTestSkipped('Password updates are not enabled.');

return;
}

Notification::fake();
Expand Down
6 changes: 0 additions & 6 deletions stubs/tests/RegistrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public function test_registration_screen_can_be_rendered(): void
{
if (! Features::enabled(Features::registration())) {
$this->markTestSkipped('Registration support is not enabled.');

return;
}

$response = $this->get('/register');
Expand All @@ -29,8 +27,6 @@ public function test_registration_screen_cannot_be_rendered_if_support_is_disabl
{
if (Features::enabled(Features::registration())) {
$this->markTestSkipped('Registration support is enabled.');

return;
}

$response = $this->get('/register');
Expand All @@ -42,8 +38,6 @@ public function test_new_users_can_register(): void
{
if (! Features::enabled(Features::registration())) {
$this->markTestSkipped('Registration support is not enabled.');

return;
}

$response = $this->post('/register', [
Expand Down
2 changes: 0 additions & 2 deletions stubs/tests/inertia/ApiTokenPermissionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public function test_api_token_permissions_can_be_updated(): void
{
if (! Features::hasApiFeatures()) {
$this->markTestSkipped('API support is not enabled.');

return;
}

$this->actingAs($user = User::factory()->withPersonalTeam()->create());
Expand Down
2 changes: 0 additions & 2 deletions stubs/tests/inertia/CreateApiTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public function test_api_tokens_can_be_created(): void
{
if (! Features::hasApiFeatures()) {
$this->markTestSkipped('API support is not enabled.');

return;
}

$this->actingAs($user = User::factory()->withPersonalTeam()->create());
Expand Down
4 changes: 0 additions & 4 deletions stubs/tests/inertia/DeleteAccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public function test_user_accounts_can_be_deleted(): void
{
if (! Features::hasAccountDeletionFeatures()) {
$this->markTestSkipped('Account deletion is not enabled.');

return;
}

$this->actingAs($user = User::factory()->create());
Expand All @@ -32,8 +30,6 @@ public function test_correct_password_must_be_provided_before_account_can_be_del
{
if (! Features::hasAccountDeletionFeatures()) {
$this->markTestSkipped('Account deletion is not enabled.');

return;
}

$this->actingAs($user = User::factory()->create());
Expand Down
2 changes: 0 additions & 2 deletions stubs/tests/inertia/DeleteApiTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public function test_api_tokens_can_be_deleted(): void
{
if (! Features::hasApiFeatures()) {
$this->markTestSkipped('API support is not enabled.');

return;
}

$this->actingAs($user = User::factory()->withPersonalTeam()->create());
Expand Down
4 changes: 0 additions & 4 deletions stubs/tests/inertia/InviteTeamMemberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public function test_team_members_can_be_invited_to_team(): void
{
if (! Features::sendsTeamInvitations()) {
$this->markTestSkipped('Team invitations not enabled.');

return;
}

Mail::fake();
Expand All @@ -39,8 +37,6 @@ public function test_team_member_invitations_can_be_cancelled(): void
{
if (! Features::sendsTeamInvitations()) {
$this->markTestSkipped('Team invitations not enabled.');

return;
}

Mail::fake();
Expand Down
6 changes: 0 additions & 6 deletions stubs/tests/inertia/TwoFactorAuthenticationSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public function test_two_factor_authentication_can_be_enabled(): void
{
if (! Features::canManageTwoFactorAuthentication()) {
$this->markTestSkipped('Two factor authentication is not enabled.');

return;
}

$this->actingAs($user = User::factory()->create());
Expand All @@ -33,8 +31,6 @@ public function test_recovery_codes_can_be_regenerated(): void
{
if (! Features::canManageTwoFactorAuthentication()) {
$this->markTestSkipped('Two factor authentication is not enabled.');

return;
}

$this->actingAs($user = User::factory()->create());
Expand All @@ -56,8 +52,6 @@ public function test_two_factor_authentication_can_be_disabled(): void
{
if (! Features::canManageTwoFactorAuthentication()) {
$this->markTestSkipped('Two factor authentication is not enabled.');

return;
}

$this->actingAs($user = User::factory()->create());
Expand Down
2 changes: 0 additions & 2 deletions stubs/tests/livewire/ApiTokenPermissionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public function test_api_token_permissions_can_be_updated(): void
{
if (! Features::hasApiFeatures()) {
$this->markTestSkipped('API support is not enabled.');

return;
}

$this->actingAs($user = User::factory()->withPersonalTeam()->create());
Expand Down
2 changes: 0 additions & 2 deletions stubs/tests/livewire/CreateApiTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public function test_api_tokens_can_be_created(): void
{
if (! Features::hasApiFeatures()) {
$this->markTestSkipped('API support is not enabled.');

return;
}

$this->actingAs($user = User::factory()->withPersonalTeam()->create());
Expand Down
4 changes: 0 additions & 4 deletions stubs/tests/livewire/DeleteAccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public function test_user_accounts_can_be_deleted(): void
{
if (! Features::hasAccountDeletionFeatures()) {
$this->markTestSkipped('Account deletion is not enabled.');

return;
}

$this->actingAs($user = User::factory()->create());
Expand All @@ -34,8 +32,6 @@ public function test_correct_password_must_be_provided_before_account_can_be_del
{
if (! Features::hasAccountDeletionFeatures()) {
$this->markTestSkipped('Account deletion is not enabled.');

return;
}

$this->actingAs($user = User::factory()->create());
Expand Down
2 changes: 0 additions & 2 deletions stubs/tests/livewire/DeleteApiTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public function test_api_tokens_can_be_deleted(): void
{
if (! Features::hasApiFeatures()) {
$this->markTestSkipped('API support is not enabled.');

return;
}

$this->actingAs($user = User::factory()->withPersonalTeam()->create());
Expand Down
4 changes: 0 additions & 4 deletions stubs/tests/livewire/InviteTeamMemberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ public function test_team_members_can_be_invited_to_team(): void
{
if (! Features::sendsTeamInvitations()) {
$this->markTestSkipped('Team invitations not enabled.');

return;
}

Mail::fake();
Expand All @@ -42,8 +40,6 @@ public function test_team_member_invitations_can_be_cancelled(): void
{
if (! Features::sendsTeamInvitations()) {
$this->markTestSkipped('Team invitations not enabled.');

return;
}

Mail::fake();
Expand Down
6 changes: 0 additions & 6 deletions stubs/tests/livewire/TwoFactorAuthenticationSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public function test_two_factor_authentication_can_be_enabled(): void
{
if (! Features::canManageTwoFactorAuthentication()) {
$this->markTestSkipped('Two factor authentication is not enabled.');

return;
}

$this->actingAs($user = User::factory()->create());
Expand All @@ -38,8 +36,6 @@ public function test_recovery_codes_can_be_regenerated(): void
{
if (! Features::canManageTwoFactorAuthentication()) {
$this->markTestSkipped('Two factor authentication is not enabled.');

return;
}

$this->actingAs($user = User::factory()->create());
Expand All @@ -62,8 +58,6 @@ public function test_two_factor_authentication_can_be_disabled(): void
{
if (! Features::canManageTwoFactorAuthentication()) {
$this->markTestSkipped('Two factor authentication is not enabled.');

return;
}

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