浏览代码

fix unit tests

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