Skip to content

Commit febe4dc

Browse files
committed
Fixed tests
1 parent ecccbb1 commit febe4dc

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

Protocols/EPP/eppRequests/eppTransferRequest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ public function setDomainRequest(eppDomain $domain) {
177177
}
178178
if (strlen($domain->getAuthorisationCode())) {
179179
$authinfo = $this->createElement('domain:authInfo');
180-
$authinfo->appendChild($this->createElement('domain:pw', $domain->getAuthorisationCode()));
180+
$pw = $authinfo->appendChild($this->createElement('domain:pw'));
181+
$pw->appendChild($this->createCDATASection($domain->getAuthorisationCode()));
182+
//$authinfo->appendChild($this->createElement('domain:pw', $domain->getAuthorisationCode()));
181183
$this->domainobject->appendChild($authinfo);
182184
}
183185
$transfer->appendChild($this->domainobject);

Tests/eppCheckDomainTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testCheckDomainTaken() {
6565
* Expects a standard result for a taken domain name
6666
*/
6767
public function testCheckDomainReserved() {
68-
$domainname = 'test'.$this->extension;
68+
$domainname = 'nic'.$this->extension;
6969
$domain = new Metaregistrar\EPP\eppDomain($domainname);
7070
$this->assertInstanceOf('Metaregistrar\EPP\eppDomain',$domain);
7171
$check = new Metaregistrar\EPP\eppCheckRequest($domain);

Tests/eppCreateContactTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33

44
class eppCreateContactTest extends eppTestCase {
55

6+
public function testClientCreateContact() {
7+
$name = 'jay';
8+
$city = 'Amsterdam';
9+
$country = 'NL';
10+
$organization = null;
11+
$address= 'Pomme1';
12+
$postcode = '7905BA';
13+
$telephone = '+31.612413333';
14+
$email = '[email protected]';
15+
$contactinfo = new Metaregistrar\EPP\eppContact(new Metaregistrar\EPP\EppContactPostalInfo($name, $city, $country, $organization, $address, null, $postcode, Metaregistrar\EPP\eppContact::TYPE_LOC), $email, $telephone);
16+
$response = $this->conn->request(new \Metaregistrar\EPP\eppCreateContactRequest($contactinfo));
17+
$this->assertEquals('1000',$response->getResultCode());
18+
}
19+
620
public function testCreateContact() {
721
$name = 'Test name';
822
$city = 'Test city';

Tests/eppCreateDnsTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testCreateDnsWrongType()
4141
$records[] = ['type' => 'GARBAGE', 'name' => $domainname, 'content' => '127.0.0.1', 'ttl' => 3600];
4242
$create = new Metaregistrar\EPP\metaregCreateDnsRequest($domain, $records);
4343
$response = $this->conn->writeandread($create);
44-
$this->setExpectedException('Metaregistrar\EPP\eppException', 'Error 2001: Command syntax error; Element \'{http://www.metaregistrar.com/epp/dns-ext-1.0}type\': [facet \'enumeration\'] The value \'GARBAGE\' is not an element of the set {\'A\', \'AAAA\', \'CNAME\', \'MX\', \'NS\', \'SOA\', \'SPF\', \'TXT\', \'SRV\', \'DNAME\', \'CAA\'}.');
44+
$this->setExpectedException('Metaregistrar\EPP\eppException', 'Error 2001: Command syntax error; Element \'{http://www.metaregistrar.com/epp/dns-ext-1.0}type\': [facet \'enumeration\'] The value \'GARBAGE\' is not an element of the set {\'A\', \'AAAA\', \'ALIAS\', \'CNAME\', \'MX\', \'NS\', \'SOA\', \'SPF\', \'TXT\', \'SRV\', \'DNAME\', \'CAA\', \'TLSA\'}.');
4545
$this->assertFalse($response->Success());
4646
}
4747

@@ -56,7 +56,7 @@ public function testCreateDnsWrongIP()
5656
$records[] = ['type' => 'A', 'name' => $domainname, 'content' => 'GARBAGE', 'ttl' => 3600];
5757
$create = new Metaregistrar\EPP\metaregCreateDnsRequest($domain, $records);
5858
$response = $this->conn->writeandread($create);
59-
$this->setExpectedException('Metaregistrar\EPP\eppException', 'Error 2004: Parameter value range error; Ip \'GARBAGE\' is not a valid IPV4 address for an A record');
59+
$this->setExpectedException('Metaregistrar\EPP\eppException', 'Error 2004: Parameter value range error; Invalid IPV4 address "GARBAGE" for A record '.$domainname);
6060
$this->assertFalse($response->Success());
6161
}
6262

@@ -70,7 +70,7 @@ public function testCreateDnsWrongDomain() {
7070
$records[] = ['type' => 'A', 'name' => 'wrongdomainname.frl', 'content' => '127.0.0.1', 'ttl' => 3600];
7171
$create = new Metaregistrar\EPP\metaregCreateDnsRequest($domain, $records);
7272
$response = $this->conn->writeandread($create);
73-
$this->setExpectedException('Metaregistrar\EPP\eppException', 'Error 2004: Parameter value range error; Name field wrongdomainname.frl is not a valid name in an A type record');
73+
$this->setExpectedException('Metaregistrar\EPP\eppException', 'Error 2004: Parameter value range error; Invalid name for A record wrongdomainname.frl does not belong with '.$domainname);
7474
$this->assertFalse($response->Success());
7575
}
7676
}

Tests/eppCreateTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function testCreateInterface() {
1010
$conn = Metaregistrar\EPP\eppConnection::create(dirname(__FILE__).'/testsetup.ini');
1111
$this->assertInstanceOf('Metaregistrar\EPP\metaregEppConnection',$conn);
1212
/* @var $conn Metaregistrar\EPP\metaregEppConnection */
13-
$this->assertEquals($conn->getHostname(),'eppltest1.metaregistrar.com');
13+
$this->assertEquals($conn->getHostname(),'eppltest2.metaregistrar.com');
1414
$this->assertEquals($conn->getPort(),7000);
1515
}
1616

0 commit comments

Comments
 (0)