- Create a new Blade view for domain registration (`registrant-tochuc.blade.php`) to capture organization and manager details. - Implement email templates for new domain orders for both admin (`domain-order-new.blade.php`) and customers (`domain-order-received.blade.php`). - Add CSV exports for client and domain data. - Introduce tests for customer mass assignment, password reset, login throttling, and permission gating. - Ensure service renewals use current pricing and validate ownership for virtual machines. - Validate mass assignment behavior in service model.
32 lines
811 B
PHP
32 lines
811 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit;
|
|
|
|
use App\Models\Customer;
|
|
use App\Models\Service;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
class ServiceFillableTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_service_ignores_fields_not_declared_in_fillable(): void
|
|
{
|
|
$customer = Customer::factory()->create();
|
|
|
|
$service = Service::create([
|
|
'customer_id' => $customer->id,
|
|
'server_name' => 'test-server',
|
|
'status' => 'active',
|
|
// Không nằm trong $fillable — không được set qua mass-assignment.
|
|
'legacy_id' => 999999,
|
|
]);
|
|
|
|
$this->assertSame('test-server', $service->server_name);
|
|
$this->assertNull($service->legacy_id);
|
|
}
|
|
}
|