Olivier Massot пре 5 месеци
родитељ
комит
034ac66724
1 измењених фајлова са 8 додато и 0 уклоњено
  1. 8 0
      tests/Unit/Service/Typo3/SubdomainServiceTest.php

+ 8 - 0
tests/Unit/Service/Typo3/SubdomainServiceTest.php

@@ -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