assertSame('email', ServiceGroup::of('email', 'Email Business')); $this->assertSame('ssl', ServiceGroup::of('ssl', 'Whatever')); $this->assertSame('ssl', ServiceGroup::of('other', 'SSL - Positive')); $this->assertSame('colo', ServiceGroup::of('other', 'COLO VNPT STAR')); $this->assertSame('colo', ServiceGroup::of('server_rental', 'Chỗ đặt 1U')); $this->assertSame('dedicated', ServiceGroup::of('other', 'DEDICATED GOLD')); $this->assertSame('dedicated', ServiceGroup::of('server_rental', 'Máy chủ X')); $this->assertNull(ServiceGroup::of('other', 'Khác')); $this->assertNull(ServiceGroup::of('vps', 'colo vps')); } public function test_constrain_sql_matches_of(): void { foreach (ServiceGroup::ALL as $group) { $sql = ServiceGroup::constrain(Product::query(), $group)->toSql(); $this->assertStringContainsString('product_type', $sql, $group); } } }