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.216.103.219
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 /
Config /
Delete
Unzip
Name
Size
Permission
Date
Action
ConfigTest.php
4.73
KB
-rw-r--r--
2018-11-11 09:00
FilesystemFactoryTest.php
2.05
KB
-rw-r--r--
2018-11-11 09:00
HostsFileTest.php
5.44
KB
-rw-r--r--
2018-11-11 09:00
Save
Rename
<?php namespace React\Tests\Dns\Config; use React\Tests\Dns\TestCase; use React\Dns\Config\Config; class ConfigTest extends TestCase { public function testLoadsSystemDefault() { $config = Config::loadSystemConfigBlocking(); $this->assertInstanceOf('React\Dns\Config\Config', $config); } public function testLoadsDefaultPath() { if (DIRECTORY_SEPARATOR === '\\') { $this->markTestSkipped('Not supported on Windows'); } $config = Config::loadResolvConfBlocking(); $this->assertInstanceOf('React\Dns\Config\Config', $config); } public function testLoadsFromExplicitPath() { $config = Config::loadResolvConfBlocking(__DIR__ . '/../Fixtures/etc/resolv.conf'); $this->assertEquals(array('8.8.8.8'), $config->nameservers); } /** * @expectedException RuntimeException */ public function testLoadThrowsWhenPathIsInvalid() { Config::loadResolvConfBlocking(__DIR__ . '/invalid.conf'); } public function testParsesSingleEntryFile() { $contents = 'nameserver 8.8.8.8'; $expected = array('8.8.8.8'); $config = Config::loadResolvConfBlocking('data://text/plain;base64,' . base64_encode($contents)); $this->assertEquals($expected, $config->nameservers); } public function testParsesNameserverEntriesFromAverageFileCorrectly() { $contents = '# # Mac OS X Notice # # This file is not used by the host name and address resolution # or the DNS query routing mechanisms used by most processes on # this Mac OS X system. # # This file is automatically generated. # domain v.cablecom.net nameserver 127.0.0.1 nameserver ::1 '; $expected = array('127.0.0.1', '::1'); $config = Config::loadResolvConfBlocking('data://text/plain;base64,' . base64_encode($contents)); $this->assertEquals($expected, $config->nameservers); } public function testParsesEmptyFileWithoutNameserverEntries() { $contents = ''; $expected = array(); $config = Config::loadResolvConfBlocking('data://text/plain;base64,'); $this->assertEquals($expected, $config->nameservers); } public function testParsesFileAndIgnoresCommentsAndInvalidNameserverEntries() { $contents = ' # nameserver 1.2.3.4 ; nameserver 2.3.4.5 nameserver 3.4.5.6 # nope nameserver 4.5.6.7 5.6.7.8 nameserver 6.7.8.9 NameServer 7.8.9.10 '; $expected = array(); $config = Config::loadResolvConfBlocking('data://text/plain;base64,' . base64_encode($contents)); $this->assertEquals($expected, $config->nameservers); } public function testLoadsFromWmicOnWindows() { if (DIRECTORY_SEPARATOR !== '\\') { $this->markTestSkipped('Only on Windows'); } $config = Config::loadWmicBlocking(); $this->assertInstanceOf('React\Dns\Config\Config', $config); } public function testLoadsSingleEntryFromWmicOutput() { $contents = ' Node,DNSServerSearchOrder ACE, ACE,{192.168.2.1} ACE, '; $expected = array('192.168.2.1'); $config = Config::loadWmicBlocking($this->echoCommand($contents)); $this->assertEquals($expected, $config->nameservers); } public function testLoadsEmptyListFromWmicOutput() { $contents = ' Node,DNSServerSearchOrder ACE, '; $expected = array(); $config = Config::loadWmicBlocking($this->echoCommand($contents)); $this->assertEquals($expected, $config->nameservers); } public function testLoadsSingleEntryForMultipleNicsFromWmicOutput() { $contents = ' Node,DNSServerSearchOrder ACE, ACE,{192.168.2.1} ACE, ACE,{192.168.2.2} ACE, '; $expected = array('192.168.2.1', '192.168.2.2'); $config = Config::loadWmicBlocking($this->echoCommand($contents)); $this->assertEquals($expected, $config->nameservers); } public function testLoadsMultipleEntriesForSingleNicWithSemicolonFromWmicOutput() { $contents = ' Node,DNSServerSearchOrder ACE, ACE,{192.168.2.1;192.168.2.2} ACE, '; $expected = array('192.168.2.1', '192.168.2.2'); $config = Config::loadWmicBlocking($this->echoCommand($contents)); $this->assertEquals($expected, $config->nameservers); } public function testLoadsMultipleEntriesForSingleNicWithQuotesFromWmicOutput() { $contents = ' Node,DNSServerSearchOrder ACE, ACE,{"192.168.2.1","192.168.2.2"} ACE, '; $expected = array('192.168.2.1', '192.168.2.2'); $config = Config::loadWmicBlocking($this->echoCommand($contents)); $this->assertEquals($expected, $config->nameservers); } private function echoCommand($output) { return 'echo ' . escapeshellarg($output); } }