Skip to content

Commit

Permalink
Full implement test of domainCheck and nameserverZoneInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Hecke29 committed Jul 18, 2018
1 parent 3b0561e commit 7db0024
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tests/Client/DomainClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public function testBasicJson()
$this->assertInstanceOf(CheckResponse::class, $response);
$this->assertFalse($response->isAvailable());
$this->assertEquals('connect', $response->getDetailedStatus());
$this->assertEquals(1000, $response->getReturnCode());
$this->assertEquals(0, $response->getReturnSubCode());
$this->assertNull($response->getReturnMessage());
}

}
21 changes: 20 additions & 1 deletion tests/Client/NameServerClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,26 @@ public function testZoneInfo()
$soapClient = $this->getSoapClient('nameserverZoneInfo', $this->createStdClassFromApiResponse($response));
$nameServerClient = $this->getNameServerClient($soapClient);

$this->assertInstanceOf(ZoneInfoResponse::class, $nameServerClient->zoneInfo('example.org'));
$response = $nameServerClient->zoneInfo('example.org');
$this->assertInstanceOf(ZoneInfoResponse::class, $response);

$this->assertEquals('example.org', $response->getOrigin());
$this->assertEquals(28800, $response->getRefresh());
$this->assertEquals(7200, $response->getRetry());
$this->assertEquals(604800, $response->getExpire());
$this->assertEquals(86400, $response->getTtl());
$this->assertEquals(300, $response->getMinimumTtl());
$this->assertEquals(1000, $response->getReturnCode());
$this->assertNull($response->getReturnSubCode());
$this->assertNull($response->getReturnMessage());

$this->assertCount(1, $response->getRrList());
$rr = $response->getRrList()[0];
$this->assertEquals(0, $rr->getAux());
$this->assertEquals('192.168.1.3', $rr->getData());
$this->assertEquals('myhost03', $rr->getName());
$this->assertEquals(86400, $rr->getTtl());
$this->assertEquals('A', $rr->getType());
}

}

0 comments on commit 7db0024

Please sign in to comment.