Add feature tests for domain order management

- Implement AdminDomainOrderTest to cover admin functionalities for domain orders including listing, confirming registration, KYC updates, activation, rejection, and refunds.
- Implement ClientDomainOrderTest to cover client functionalities for placing domain orders, including validation for balance, duplicate orders, and domain normalization.
- Ensure proper handling of domain pricing and service statuses throughout the tests.
This commit is contained in:
baodev0
2026-07-10 14:16:35 +07:00
parent 61c0e026c8
commit dfb926055d
81 changed files with 35743 additions and 481 deletions
+3 -4
View File
@@ -17,12 +17,11 @@ class CustomerFactory extends Factory
public function definition()
{
return [
'firstname' => $this->faker->name(),
'lastname' => $this->faker->name(),
'fullname' => $this->faker->name(),
'phone' => $this->faker->unique()->phoneNumber(),
'email' => $this->faker->unique()->email(),
'email' => $this->faker->unique()->safeEmail(),
'email_verify' => now(),
'password' => '$2y$10$2Tcx805kaC.Ug/IUD34pW.R.D0l0Gpy.IEeXkrjhBr1uu048pEFp.'
'password' => '$2y$10$2Tcx805kaC.Ug/IUD34pW.R.D0l0Gpy.IEeXkrjhBr1uu048pEFp.',
];
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Product>
*/
class ProductFactory extends Factory
{
public function definition(): array
{
$slug = Str::slug($this->faker->unique()->words(3, true));
$categoryId = DB::table('product_categories')->insertGetId([
'name' => 'Test Category ' . $this->faker->unique()->numberBetween(1, 9999),
'slug' => 'cat-' . $slug,
'type' => null, // null so boot() hook does not override product_type
'is_active' => true,
'sort_order' => 0,
'created_at' => now(),
'updated_at' => now(),
]);
return [
'product_categories_id' => $categoryId,
'product_type' => 'domain',
'name' => $this->faker->unique()->words(2, true),
'slug' => $slug,
'is_active' => true,
'is_unlimited' => true,
'setup_fee' => 0,
'trial_days' => 0,
'sort_order' => 0,
];
}
}