Permalink
Browse files

Instantiate only once, remove environment specific hardcoding

git-svn-id: http://svn.php.net/repository/pear/packages/Net_DNS/trunk@304900 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 524fbc4 commit fec5230cd9c16eea98e851455e6634883aca0cc6 @CloCkWeRX CloCkWeRX committed Oct 25, 2010
Showing with 9 additions and 5 deletions.
  1. +9 −5 tests/Net_DNS_ResolverTest.php
@@ -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();
@@ -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();
@@ -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);
@@ -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');

0 comments on commit fec5230

Please sign in to comment.