chore: code refactor via rector

This commit is contained in:
idevakk
2025-11-14 02:01:01 -08:00
parent 90ab79b3a2
commit ae795880ed
148 changed files with 1520 additions and 1486 deletions

View File

@@ -14,7 +14,7 @@ use Tests\TestCase;
class RegisterTest extends TestCase
{
/** @test */
public function it_renders_the_register_component()
public function it_renders_the_register_component(): void
{
$component = Livewire::test(Register::class);
@@ -25,7 +25,7 @@ class RegisterTest extends TestCase
}
/** @test */
public function it_validates_required_name_field()
public function it_validates_required_name_field(): void
{
$component = Livewire::test(Register::class);
@@ -38,7 +38,7 @@ class RegisterTest extends TestCase
}
/** @test */
public function it_validates_required_email_field()
public function it_validates_required_email_field(): void
{
$component = Livewire::test(Register::class);
@@ -51,7 +51,7 @@ class RegisterTest extends TestCase
}
/** @test */
public function it_validates_email_format()
public function it_validates_email_format(): void
{
$component = Livewire::test(Register::class);
@@ -65,7 +65,7 @@ class RegisterTest extends TestCase
}
/** @test */
public function it_validates_required_password_field()
public function it_validates_required_password_field(): void
{
$component = Livewire::test(Register::class);
@@ -78,7 +78,7 @@ class RegisterTest extends TestCase
}
/** @test */
public function it_validates_password_confirmation()
public function it_validates_password_confirmation(): void
{
$component = Livewire::test(Register::class);
@@ -92,7 +92,7 @@ class RegisterTest extends TestCase
}
/** @test */
public function it_creates_user_with_valid_data()
public function it_creates_user_with_valid_data(): void
{
Event::fake();
@@ -110,12 +110,12 @@ class RegisterTest extends TestCase
'email' => 'test@gmail.com',
]);
$this->assertAuthenticatedAs(User::where('email', 'test@gmail.com')->first());
$this->assertAuthenticatedAs(User::query()->where('email', 'test@gmail.com')->first());
Event::assertDispatched(Registered::class);
}
/** @test */
public function it_hashes_password_before_storing()
public function it_hashes_password_before_storing(): void
{
$component = Livewire::test(Register::class);
@@ -126,12 +126,12 @@ class RegisterTest extends TestCase
->set('password_confirmation', 'Password123!')
->call('register');
$user = User::where('email', 'test@gmail.com')->first();
$user = User::query()->where('email', 'test@gmail.com')->first();
$this->assertTrue(Hash::check('Password123!', $user->password));
}
/** @test */
public function it_prevents_duplicate_email_registration()
public function it_prevents_duplicate_email_registration(): void
{
// Create existing user
User::factory()->create(['email' => 'test@gmail.com']);
@@ -148,7 +148,7 @@ class RegisterTest extends TestCase
}
/** @test */
public function it_redirects_after_successful_registration()
public function it_redirects_after_successful_registration(): void
{
$component = Livewire::test(Register::class);
@@ -163,7 +163,7 @@ class RegisterTest extends TestCase
}
/** @test */
public function it_logs_in_user_after_registration()
public function it_logs_in_user_after_registration(): void
{
$component = Livewire::test(Register::class);
@@ -179,7 +179,7 @@ class RegisterTest extends TestCase
}
/** @test */
public function it_handles_maximum_name_length()
public function it_handles_maximum_name_length(): void
{
$component = Livewire::test(Register::class);
@@ -193,7 +193,7 @@ class RegisterTest extends TestCase
}
/** @test */
public function it_handles_password_validation()
public function it_handles_password_validation(): void
{
$component = Livewire::test(Register::class);