File tree Expand file tree Collapse file tree 6 files changed +127
-3
lines changed
Expand file tree Collapse file tree 6 files changed +127
-3
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments