@@ -322,6 +322,7 @@ public function testItCanChangeItsSuffix(
322
322
public static function withPublicSuffixWorksProvider (): iterable
323
323
{
324
324
$ baseDomain = ResolvedDomain::fromICANN ('example.com ' , 1 );
325
+ $ baseRootDomain = ResolvedDomain::fromICANN ('example.com. ' , 1 );
325
326
326
327
return [
327
328
'simple update (1) ' => [
@@ -332,6 +333,14 @@ public static function withPublicSuffixWorksProvider(): iterable
332
333
'isICANN ' => false ,
333
334
'isPrivate ' => false ,
334
335
],
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
+ ],
335
344
'simple update (2) ' => [
336
345
'domain ' => $ baseDomain ,
337
346
'publicSuffix ' => Suffix::fromPrivate ('github.io ' ),
@@ -340,6 +349,14 @@ public static function withPublicSuffixWorksProvider(): iterable
340
349
'isICANN ' => false ,
341
350
'isPrivate ' => true ,
342
351
],
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
+ ],
343
360
'same public suffix but PSL info is changed ' => [
344
361
'domain ' => $ baseDomain ,
345
362
'publicSuffix ' => Suffix::fromPrivate ('com ' ),
@@ -348,6 +365,14 @@ public static function withPublicSuffixWorksProvider(): iterable
348
365
'isICANN ' => false ,
349
366
'isPrivate ' => true ,
350
367
],
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
+ ],
351
376
'same public suffix but PSL info does not changed ' => [
352
377
'domain ' => $ baseDomain ,
353
378
'publicSuffix ' => Suffix::fromICANN ('com ' ),
@@ -372,6 +397,14 @@ public static function withPublicSuffixWorksProvider(): iterable
372
397
'isICANN ' => true ,
373
398
'isPrivate ' => false ,
374
399
],
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
+ ],
375
408
'adding the public suffix to a single label domain ' => [
376
409
'domain ' => ResolvedDomain::fromUnknown ('localhost ' ),
377
410
'publicSuffix ' => 'www ' ,
0 commit comments