|
|
@@ -159,12 +159,20 @@ class SubdomainServiceTest extends TestCase
|
|
|
],
|
|
|
]);
|
|
|
|
|
|
+ // Exact match for 'abcd' should be reserved
|
|
|
$this->assertTrue($subdomainService->isReservedSubdomain('abcd'));
|
|
|
+
|
|
|
+ // Pattern match for 'abc\d+' should be reserved
|
|
|
$this->assertTrue($subdomainService->isReservedSubdomain('abc123'));
|
|
|
|
|
|
+ // These should not match any reserved pattern
|
|
|
$this->assertFalse($subdomainService->isReservedSubdomain('abcde'));
|
|
|
$this->assertFalse($subdomainService->isReservedSubdomain('abc'));
|
|
|
$this->assertFalse($subdomainService->isReservedSubdomain('foo'));
|
|
|
+
|
|
|
+ // Test word boundary behavior
|
|
|
+ $this->assertFalse($subdomainService->isReservedSubdomain('myabcd')); // Should not match due to word boundary
|
|
|
+ $this->assertFalse($subdomainService->isReservedSubdomain('abcdfoo')); // Should not match due to word boundary
|
|
|
}
|
|
|
|
|
|
public function testIsRegisteredSubdomain(): void
|