Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.188.73.229
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
unp /
vendor /
react /
dns /
tests /
Query /
Delete
Unzip
Name
Size
Permission
Date
Action
CachedExecutorTest.php
3.39
KB
-rw-r--r--
2018-11-11 09:00
ExecutorTest.php
9.73
KB
-rw-r--r--
2018-11-11 09:00
HostsFileExecutorTest.php
5.06
KB
-rw-r--r--
2018-11-11 09:00
RecordBagTest.php
2.66
KB
-rw-r--r--
2018-11-11 09:00
RecordCacheTest.php
6.88
KB
-rw-r--r--
2018-11-11 09:00
RetryExecutorTest.php
11.18
KB
-rw-r--r--
2018-11-11 09:00
TimeoutExecutorTest.php
3.69
KB
-rw-r--r--
2018-11-11 09:00
UdpTransportExecutorTest.php
7.05
KB
-rw-r--r--
2018-11-11 09:00
Save
Rename
<?php namespace React\Tests\Dns\Query; use React\Tests\Dns\TestCase; use React\Dns\Query\HostsFileExecutor; use React\Dns\Query\Query; use React\Dns\Model\Message; class HostsFileExecutorTest extends TestCase { private $hosts; private $fallback; private $executor; public function setUp() { $this->hosts = $this->getMockBuilder('React\Dns\Config\HostsFile')->disableOriginalConstructor()->getMock(); $this->fallback = $this->getMockBuilder('React\Dns\Query\ExecutorInterface')->getMock(); $this->executor = new HostsFileExecutor($this->hosts, $this->fallback); } public function testDoesNotTryToGetIpsForMxQuery() { $this->hosts->expects($this->never())->method('getIpsForHost'); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_MX, Message::CLASS_IN, 0)); } public function testFallsBackIfNoIpsWereFound() { $this->hosts->expects($this->once())->method('getIpsForHost')->willReturn(array()); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_A, Message::CLASS_IN, 0)); } public function testReturnsResponseMessageIfIpsWereFound() { $this->hosts->expects($this->once())->method('getIpsForHost')->willReturn(array('127.0.0.1')); $this->fallback->expects($this->never())->method('query'); $ret = $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_A, Message::CLASS_IN, 0)); } public function testFallsBackIfNoIpv4Matches() { $this->hosts->expects($this->once())->method('getIpsForHost')->willReturn(array('::1')); $this->fallback->expects($this->once())->method('query'); $ret = $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_A, Message::CLASS_IN, 0)); } public function testReturnsResponseMessageIfIpv6AddressesWereFound() { $this->hosts->expects($this->once())->method('getIpsForHost')->willReturn(array('::1')); $this->fallback->expects($this->never())->method('query'); $ret = $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_AAAA, Message::CLASS_IN, 0)); } public function testFallsBackIfNoIpv6Matches() { $this->hosts->expects($this->once())->method('getIpsForHost')->willReturn(array('127.0.0.1')); $this->fallback->expects($this->once())->method('query'); $ret = $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_AAAA, Message::CLASS_IN, 0)); } public function testDoesReturnReverseIpv4Lookup() { $this->hosts->expects($this->once())->method('getHostsForIp')->with('127.0.0.1')->willReturn(array('localhost')); $this->fallback->expects($this->never())->method('query'); $this->executor->query('8.8.8.8', new Query('1.0.0.127.in-addr.arpa', Message::TYPE_PTR, Message::CLASS_IN, 0)); } public function testFallsBackIfNoReverseIpv4Matches() { $this->hosts->expects($this->once())->method('getHostsForIp')->with('127.0.0.1')->willReturn(array()); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('1.0.0.127.in-addr.arpa', Message::TYPE_PTR, Message::CLASS_IN, 0)); } public function testDoesReturnReverseIpv6Lookup() { $this->hosts->expects($this->once())->method('getHostsForIp')->with('2a02:2e0:3fe:100::6')->willReturn(array('ip6-localhost')); $this->fallback->expects($this->never())->method('query'); $this->executor->query('8.8.8.8', new Query('6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.e.f.3.0.0.e.2.0.2.0.a.2.ip6.arpa', Message::TYPE_PTR, Message::CLASS_IN, 0)); } public function testFallsBackForInvalidAddress() { $this->hosts->expects($this->never())->method('getHostsForIp'); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('example.com', Message::TYPE_PTR, Message::CLASS_IN, 0)); } public function testReverseFallsBackForInvalidIpv4Address() { $this->hosts->expects($this->never())->method('getHostsForIp'); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('::1.in-addr.arpa', Message::TYPE_PTR, Message::CLASS_IN, 0)); } public function testReverseFallsBackForInvalidLengthIpv6Address() { $this->hosts->expects($this->never())->method('getHostsForIp'); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('abcd.ip6.arpa', Message::TYPE_PTR, Message::CLASS_IN, 0)); } public function testReverseFallsBackForInvalidHexIpv6Address() { $this->hosts->expects($this->never())->method('getHostsForIp'); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('zZz.ip6.arpa', Message::TYPE_PTR, Message::CLASS_IN, 0)); } }