public function testTld()
 {
     $tld = new Tld('foo');
     $this->assertEquals('foo', $tld->getTld());
     $this->assertEquals('foo', strval($tld));
     $this->assertFalse($tld->isCcTld());
     $this->assertNull($tld->getCcTld());
     $this->assertTrue($tld->equals(new Tld('foo')));
     $tld = new Tld('com.au');
     $this->assertEquals('com.au', $tld->getTld());
     $this->assertEquals('com.au', strval($tld));
     $this->assertTrue($tld->isCcTld());
     $this->assertEquals('au', $tld->getCcTld());
     $this->assertTrue($tld->equals(new Tld('com.au')));
 }
Exemple #2
0
 /**
  * @dataProvider providerForInvalidTld
  */
 public function testShouldInvalidateInputWhenItIsNotAValidTld($input)
 {
     $rule = new Tld();
     $this->assertFalse($rule->validate($input));
 }