Пример #1
0
 /**
  *
  */
 public function testReverseIpv6()
 {
     $case_1 = '2001:db8::567:89ab';
     $case_2 = '8007:ea:19';
     $exp_1 = 'b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.';
     $exp_2 = '9.1.0.0.a.e.0.0.7.0.0.8.ip6.arpa.';
     $this->assertEquals($exp_1, Toolbox::reverseIpv6($case_1));
     $this->assertEquals($exp_2, Toolbox::reverseIpv6($case_2));
 }
Пример #2
0
 /**
  *
  */
 public function testReverseIpv6Record()
 {
     $origin = Toolbox::reverseIpv6('2001:f83:21');
     $soa = new ResourceRecord('@', Factory::Soa('example.com.', 'post.example.com.', 2015010101, 3600, 14400, 604800, 3600), null, Classes::INTERNET);
     $ns1 = new ResourceRecord('@', Factory::Ns('ns1.example.com.'), null, Classes::INTERNET);
     $ns2 = new ResourceRecord('@', Factory::Ns('ns2.example.com.'), null, Classes::INTERNET);
     $foo8 = new ResourceRecord('8', Factory::Ptr('foo8.example.com.'), null, Classes::INTERNET);
     $foo9 = new ResourceRecord('9', Factory::Ptr('foo9.example.com.'), null, Classes::INTERNET);
     $fooa = new ResourceRecord('a', Factory::Ptr('fooa.example.com.'), null, Classes::INTERNET);
     $foob = new ResourceRecord('b', Factory::Ptr('foob.example.com.'), null, Classes::INTERNET);
     $fooc = new ResourceRecord('c', Factory::Ptr('fooc.example.com.'), null, Classes::INTERNET);
     $zone = new Zone($origin, 14400, [$soa, $ns1, $ns2, $foo8, $foo9, $fooa, $foob, $fooc]);
     $builder = new ZoneBuilder();
     $this->assertEquals($this->expectedIpv6Record, $builder->build($zone));
     $this->bindTest($zone, $builder);
 }