for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of PHP DNS Server.
*
* (c) Yif Swery <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace yswery\DNS\Tests;
use yswery\DNS\RecordTypeEnum;
use yswery\DNS\ResourceRecord;
use yswery\DNS\Resolver\ResolverInterface;
class DummyResolver implements ResolverInterface
{
public function isAuthority($domain): bool
return true;
}
public function allowsRecursion(): bool
return false;
/**
* @param ResourceRecord[] $queries
* @return array
public function getAnswer(array $queries): array
$q = $queries[0];
return [(new ResourceRecord())
->setName($q->getName())
->setClass($q->getClass())
->setTtl(300)
->setType(RecordTypeEnum::TYPE_OPT)
->setRdata('Some data'), ];