Skip to content

Commit

Permalink
Instantiate only once, remove environment specific hardcoding
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/Net_DNS/trunk@304900 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
CloCkWeRX committed Oct 25, 2010
1 parent 524fbc4 commit fec5230
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/Net_DNS_ResolverTest.php
Expand Up @@ -3,8 +3,12 @@

class Net_DNS_ResolverTest extends PHPUnit_Framework_TestCase {

public function setUp() {
$this->resolver = new Net_DNS_Resolver(array(/*'debug' => 1*/));
}

public function testBug16501() {
$resolver = new Net_DNS_Resolver(array('nameservers' => array('192.168.0.1')));
$resolver = $this->resolver;

$packet = new Net_DNS_Packet();

Expand Down Expand Up @@ -33,7 +37,7 @@ public function testBug16501() {
}

public function testBug16502() {
$resolver = new Net_DNS_Resolver(array('nameservers' => array('192.168.0.1')));
$resolver = $this->resolver;

$packet = new Net_DNS_Packet();

Expand All @@ -54,11 +58,12 @@ public function testBug16502() {
$packet->header->arcount = count($packet->additional);
$response = $resolver->send_tcp($packet, $packet->data());

$this->assertTrue($response instanceof Net_DNS_Packet);
$this->assertSame("NOERROR", $response->header->rcode);
}

public function testBug16515() {
$r = new Net_DNS_Resolver();
$r = $this->resolver;

$data = $r->query('example.com.', 'TXT');
$this->assertNotSame(false, $data);
Expand All @@ -74,8 +79,7 @@ public function testBug16515() {


public function testPregChange() {

$r = new Net_DNS_Resolver();
$r = $this->resolver;

// A
$a = Net_DNS_RR::factory('example.com. 1800 IN A 10.10.10.10');
Expand Down

0 comments on commit fec5230

Please sign in to comment.