99use PHPUnit \Framework \Attributes \DataProvider ;
1010use PHPUnit \Framework \TestCase ;
1111use Stringable ;
12- use TypeError ;
1312
1413use function dirname ;
1514
@@ -187,13 +186,6 @@ public function __toString(): string
187186 ];
188187 }
189188
190- public function testTopLevelDomainThrowsTypeError (): void
191- {
192- $ this ->expectException (TypeError::class);
193-
194- self ::$ topLevelDomains ->getIANADomain (new DateTimeImmutable ()); /* @phpstan-ignore-line */
195- }
196-
197189 public function testTopLevelDomainWithInvalidDomain (): void
198190 {
199191 $ this ->expectException (SyntaxError::class);
@@ -212,8 +204,8 @@ public function testResolveWithAbsoluteDomainName(): void
212204 {
213205 $ result = self ::$ topLevelDomains ->resolve ('example.com. ' );
214206 self ::assertSame ('example.com. ' , $ result ->value ());
215- self ::assertFalse ($ result ->suffix ()->isIANA ());
216- self ::assertNull ( $ result ->suffix ()->value ());
207+ self ::assertTrue ($ result ->suffix ()->isIANA ());
208+ self ::assertSame ( ' com ' , $ result ->suffix ()->value ());
217209 }
218210
219211 public function testTopLevelDomainWithUnResolvableDomain (): void
@@ -223,6 +215,13 @@ public function testTopLevelDomainWithUnResolvableDomain(): void
223215 self ::$ topLevelDomains ->getIANADomain ('localhost ' );
224216 }
225217
218+ public function testTopLevelDomainWithUnResolvableDomain2 (): void
219+ {
220+ $ this ->expectException (UnableToResolveDomain::class);
221+
222+ self ::$ topLevelDomains ->getIANADomain ('localhost. ' );
223+ }
224+
226225 public function testResolveWithUnResolvableDomain (): void
227226 {
228227 $ result = self ::$ topLevelDomains ->resolve ('localhost ' );
0 commit comments