Skip to content

Commit c94158d

Browse files
committed
done for now...
-
1 parent 61f905e commit c94158d

File tree

6 files changed

+127
-3
lines changed

6 files changed

+127
-3
lines changed

tests/EPP/Frame/Command/Check/DomainCheckTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testDomainCheckFrameInvalidDomain()
3737
} else {
3838
try {
3939
$frame->addDomain('invalid_domain');
40-
} catch(Exception $e) {
40+
} catch (Exception $e) {
4141
$this->assertEquals('Exception', get_class($e));
4242
}
4343
}

tests/EPP/Frame/Command/Check/HostCheckTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testHostCheckFrameInvalidHost()
3737
} else {
3838
try {
3939
$frame->addHost('invalid_host');
40-
} catch(Exception $e) {
40+
} catch (Exception $e) {
4141
$this->assertEquals('Exception', get_class($e));
4242
}
4343
}

tests/EPP/Frame/Command/Create/HostCreateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testHostCreateFrameInvalidHost()
4343
} else {
4444
try {
4545
$frame->setHost('invalid_domain');
46-
} catch(Exception $e) {
46+
} catch (Exception $e) {
4747
$this->assertEquals('Exception', get_class($e));
4848
}
4949
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace AfriCC\Tests\EPP\Frame\Command\Delete;
4+
5+
use AfriCC\EPP\Frame\Command\Delete\Contact;
6+
use PHPUnit\Framework\TestCase;
7+
8+
class ContactDeleteTest extends TestCase
9+
{
10+
public function testContactDeleteFrame()
11+
{
12+
$frame = new Contact();
13+
$frame->setId('C001');
14+
15+
$this->assertXmlStringEqualsXmlString(
16+
'<?xml version="1.0" encoding="UTF-8" standalone="no"?>
17+
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
18+
<command>
19+
<delete>
20+
<contact:delete xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
21+
<contact:id>C001</contact:id>
22+
</contact:delete>
23+
</delete>
24+
</command>
25+
</epp>
26+
',
27+
(string) $frame
28+
);
29+
}
30+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
namespace AfriCC\Tests\EPP\Frame\Command\Delete;
4+
5+
use AfriCC\EPP\Frame\Command\Delete\Domain;
6+
use Exception;
7+
use PHPUnit\Framework\TestCase;
8+
9+
class DomainDeleteTest extends TestCase
10+
{
11+
public function testDomainDeleteFrame()
12+
{
13+
$frame = new Domain();
14+
$frame->setDomain(TEST_DOMAIN);
15+
16+
$this->assertXmlStringEqualsXmlString(
17+
'<?xml version="1.0" encoding="UTF-8" standalone="no"?>
18+
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
19+
<command>
20+
<delete>
21+
<domain:delete xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
22+
<domain:name>' . TEST_DOMAIN . '</domain:name>
23+
</domain:delete>
24+
</delete>
25+
</command>
26+
</epp>
27+
',
28+
(string) $frame
29+
);
30+
}
31+
32+
public function testDomainDeleteFrameInvalidDomain()
33+
{
34+
$frame = new Domain();
35+
36+
if (method_exists($this, 'expectException')) {
37+
$this->expectException(Exception::class);
38+
$frame->setDomain('invalid_domain');
39+
} else {
40+
try {
41+
$frame->setDomain('invalid_domain');
42+
} catch (Exception $e) {
43+
$this->assertEquals('Exception', get_class($e));
44+
}
45+
}
46+
}
47+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
namespace AfriCC\Tests\EPP\Frame\Command\Delete;
4+
5+
use AfriCC\EPP\Frame\Command\Delete\Host;
6+
use Exception;
7+
use PHPUnit\Framework\TestCase;
8+
9+
class HostDeleteTest extends TestCase
10+
{
11+
public function testHostDeleteFrame()
12+
{
13+
$frame = new Host();
14+
$frame->setHost('ns1.' . TEST_DOMAIN);
15+
16+
$this->assertXmlStringEqualsXmlString(
17+
'<?xml version="1.0" encoding="UTF-8" standalone="no"?>
18+
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
19+
<command>
20+
<delete>
21+
<host:delete xmlns:host="urn:ietf:params:xml:ns:host-1.0">
22+
<host:name>ns1.' . TEST_DOMAIN . '</host:name>
23+
</host:delete>
24+
</delete>
25+
</command>
26+
</epp>
27+
',
28+
(string) $frame
29+
);
30+
}
31+
32+
public function testHostDeleteFrameInvalidHost()
33+
{
34+
$frame = new Host();
35+
36+
if (method_exists($this, 'expectException')) {
37+
$this->expectException(Exception::class);
38+
$frame->setHost('invalid_domain');
39+
} else {
40+
try {
41+
$frame->setHost('invalid_domain');
42+
} catch (Exception $e) {
43+
$this->assertEquals('Exception', get_class($e));
44+
}
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)