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

@@ -2,11 +2,13 @@
namespace Tests\Unit\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\Plan;
use Tests\TestCase;
class PlanTest extends TestCase
{
public $planData;
protected function setUp(): void
{
parent::setUp();
@@ -33,7 +35,7 @@ class PlanTest extends TestCase
}
/** @test */
public function it_can_create_a_plan_with_factory()
public function it_can_create_a_plan_with_factory(): void
{
$plan = Plan::factory()->create();
@@ -43,9 +45,9 @@ class PlanTest extends TestCase
}
/** @test */
public function it_has_correct_fillable_attributes()
public function it_has_correct_fillable_attributes(): void
{
$plan = Plan::create($this->planData);
$plan = Plan::query()->create($this->planData);
foreach ($this->planData as $key => $value) {
$this->assertEquals($value, $plan->$key);
@@ -53,7 +55,7 @@ class PlanTest extends TestCase
}
/** @test */
public function it_casts_details_to_json()
public function it_casts_details_to_json(): void
{
$details = [
'feature1' => 'Unlimited emails',
@@ -67,7 +69,7 @@ class PlanTest extends TestCase
}
/** @test */
public function it_casts_monthly_billing_to_boolean()
public function it_casts_monthly_billing_to_boolean(): void
{
$plan1 = Plan::factory()->create(['monthly_billing' => true]);
$plan2 = Plan::factory()->create(['monthly_billing' => false]);
@@ -79,7 +81,7 @@ class PlanTest extends TestCase
}
/** @test */
public function it_accepts_different_payment_methods()
public function it_accepts_different_payment_methods(): void
{
$plan = Plan::factory()->create([
'accept_stripe' => true,
@@ -93,7 +95,7 @@ class PlanTest extends TestCase
}
/** @test */
public function it_stores_monetary_values_correctly()
public function it_stores_monetary_values_correctly(): void
{
$plan = Plan::factory()->create([
'price' => 19.99,
@@ -104,7 +106,7 @@ class PlanTest extends TestCase
}
/** @test */
public function it_stores_mailbox_limit_as_integer()
public function it_stores_mailbox_limit_as_integer(): void
{
$plan = Plan::factory()->create([
'mailbox_limit' => 50,
@@ -115,7 +117,7 @@ class PlanTest extends TestCase
}
/** @test */
public function it_can_update_plan_attributes()
public function it_can_update_plan_attributes(): void
{
$plan = Plan::factory()->create();
@@ -133,7 +135,7 @@ class PlanTest extends TestCase
}
/** @test */
public function it_uses_correct_table_name()
public function it_uses_correct_table_name(): void
{
$plan = new Plan;
@@ -141,10 +143,10 @@ class PlanTest extends TestCase
}
/** @test */
public function it_extends_model_class()
public function it_extends_model_class(): void
{
$plan = new Plan;
$this->assertInstanceOf(\Illuminate\Database\Eloquent\Model::class, $plan);
$this->assertInstanceOf(Model::class, $plan);
}
}