Ejemplo n.º 1
0
 public function testWhiteSpaceAtEnd()
 {
     $expected = json_decode('[{"NAME":"www","TTL":"600","TYPE":"A","RDATA":{"ADDRESS":"5.101.153.40"}}]', true);
     $config_path = realpath(__DIR__ . "/../zone/syntax_ok/whitespaceAtEnd");
     $plain_config = file_get_contents($config_path);
     static::assertEquals($expected, Tokenizer::tokenize($plain_config));
 }
 /**
  * @expectedException \LTDBeget\dns\SyntaxErrorException
  */
 public function testWtfZone()
 {
     $config_path = realpath(__DIR__ . "/../zone/syntax_error/wtf.zone");
     $plain_config = file_get_contents($config_path);
     Tokenizer::tokenize($plain_config);
 }
 /**
  * @param Zone   $zone
  * @param string $data
  * @return Zone
  */
 public static function deserialize(Zone $zone, string $data) : Zone
 {
     return ArrayDeserializer::deserialize($zone, Tokenizer::tokenize($data));
 }