@@ -322,6 +322,7 @@ public function testItCanChangeItsSuffix(
322322 public static function withPublicSuffixWorksProvider (): iterable
323323 {
324324 $ baseDomain = ResolvedDomain::fromICANN ('example.com ' , 1 );
325+ $ baseRootDomain = ResolvedDomain::fromICANN ('example.com. ' , 1 );
325326
326327 return [
327328 'simple update (1) ' => [
@@ -332,6 +333,14 @@ public static function withPublicSuffixWorksProvider(): iterable
332333 'isICANN ' => false ,
333334 'isPrivate ' => false ,
334335 ],
336+ 'simple update with root-label (1) ' => [
337+ 'domain ' => $ baseRootDomain ,
338+ 'publicSuffix ' => 'be ' ,
339+ 'expected ' => 'be ' ,
340+ 'isKnown ' => false ,
341+ 'isICANN ' => false ,
342+ 'isPrivate ' => false ,
343+ ],
335344 'simple update (2) ' => [
336345 'domain ' => $ baseDomain ,
337346 'publicSuffix ' => Suffix::fromPrivate ('github.io ' ),
@@ -340,6 +349,14 @@ public static function withPublicSuffixWorksProvider(): iterable
340349 'isICANN ' => false ,
341350 'isPrivate ' => true ,
342351 ],
352+ 'simple update with root-label (2) ' => [
353+ 'domain ' => $ baseRootDomain ,
354+ 'publicSuffix ' => Suffix::fromPrivate ('github.io ' ),
355+ 'expected ' => 'github.io ' ,
356+ 'isKnown ' => true ,
357+ 'isICANN ' => false ,
358+ 'isPrivate ' => true ,
359+ ],
343360 'same public suffix but PSL info is changed ' => [
344361 'domain ' => $ baseDomain ,
345362 'publicSuffix ' => Suffix::fromPrivate ('com ' ),
@@ -348,6 +365,14 @@ public static function withPublicSuffixWorksProvider(): iterable
348365 'isICANN ' => false ,
349366 'isPrivate ' => true ,
350367 ],
368+ 'same public suffix but PSL info is changed with root domain ' => [
369+ 'domain ' => $ baseRootDomain ,
370+ 'publicSuffix ' => Suffix::fromPrivate ('com ' ),
371+ 'expected ' => 'com ' ,
372+ 'isKnown ' => true ,
373+ 'isICANN ' => false ,
374+ 'isPrivate ' => true ,
375+ ],
351376 'same public suffix but PSL info does not changed ' => [
352377 'domain ' => $ baseDomain ,
353378 'publicSuffix ' => Suffix::fromICANN ('com ' ),
@@ -372,6 +397,14 @@ public static function withPublicSuffixWorksProvider(): iterable
372397 'isICANN ' => true ,
373398 'isPrivate ' => false ,
374399 ],
400+ 'simple update IDN (2) with root domains ' => [
401+ 'domain ' => ResolvedDomain::fromICANN (Domain::fromIDNA2003 ('www.bébé.be. ' ), 1 ),
402+ 'publicSuffix ' => Suffix::fromICANN (Domain::fromIDNA2003 ('xn--p1ai ' )),
403+ 'expected ' => 'рф ' ,
404+ 'isKnown ' => true ,
405+ 'isICANN ' => true ,
406+ 'isPrivate ' => false ,
407+ ],
375408 'adding the public suffix to a single label domain ' => [
376409 'domain ' => ResolvedDomain::fromUnknown ('localhost ' ),
377410 'publicSuffix ' => 'www ' ,
0 commit comments