namespace Symfony\Bridge\PhpUnit\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\DnsMock;
class DnsMockTest extends TestCase
{ protected function tearDown(): void
{ DnsMock::
withMockedHosts([]);
} public function testCheckdnsrr() { DnsMock::
withMockedHosts(['example.com' =>
[['type' => 'MX'
]]]);
$this->
assertTrue(DnsMock::
checkdnsrr('example.com'
));
DnsMock::
withMockedHosts(['example.com' =>
[['type' => 'A'
]]]);
$this->
assertFalse(DnsMock::
checkdnsrr('example.com'
));
$this->
assertTrue(DnsMock::
checkdnsrr('example.com', 'a'
));
$this->
assertTrue(DnsMock::
checkdnsrr('example.com', 'any'
));