Example #1
0
 /**
  * @param string $name
  *
  * @throws DNSException
  */
 public function setName($name)
 {
     if (!Validator::rrName($name)) {
         throw new DNSException(sprintf('"%s" is not a valid resource record name.', $name));
     }
     $this->name = (string) $name;
 }
Example #2
0
 /**
  *
  */
 public function testRrName()
 {
     $case_1 = '*.';
     $case_2 = '*.hello.com';
     $case_3 = 'www.*.hello.com';
     $this->assertFalse(Validator::rrName($case_1));
     $this->assertTrue(Validator::rrName($case_2));
     $this->assertFalse(Validator::rrName($case_3));
 }