Skip to content

Commit 9ceb137

Browse files
prepare for 1.0.0 (#60)
* prepare for 1.0.0 * fixes #54
1 parent 6a8c285 commit 9ceb137

File tree

4 files changed

+92
-1
lines changed

4 files changed

+92
-1
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 1.0.0 - 2018-12-23
4+
5+
### Changes
6+
7+
- response will always be a result-array (_breaking_)
8+
9+
### Added
10+
11+
- `verify_peer_name` option (thx @panaceya)
12+
13+
### Fixed
14+
15+
- cz-nic (thx @krtcom)
16+
- php 7.2+ compat (thx @krtcom)
17+
318
## 0.3.1 - 2017-04-27
419

520
### Added

src/AfriCC/EPP/AbstractFrame.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function set($path = null, $value = null)
5959
}
6060

6161
if ($value !== null) {
62-
$this->nodes[$path]->nodeValue = $value;
62+
$this->nodes[$path]->nodeValue = htmlspecialchars($value, ENT_XML1, 'UTF-8');
6363
}
6464

6565
return $this->nodes[$path];

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,32 @@ public function testContactCreateDiscloseFrame()
254254
(string) $frame
255255
);
256256
}
257+
258+
public function testContactCreateEntities()
259+
{
260+
$frame = new Contact();
261+
$frame->setId('CONTACT1');
262+
$frame->setOrganization('Fäther & Sons"');
263+
264+
$this->assertXmlStringEqualsXmlString(
265+
'
266+
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
267+
<command>
268+
<create>
269+
<contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
270+
<contact:id>CONTACT1</contact:id>
271+
<contact:postalInfo type="loc">
272+
<contact:org>Fäther &amp; Sons"</contact:org>
273+
</contact:postalInfo>
274+
<contact:postalInfo type="int">
275+
<contact:org>Father &amp; Sons"</contact:org>
276+
</contact:postalInfo>
277+
</contact:create>
278+
</create>
279+
</command>
280+
</epp>
281+
',
282+
(string) $frame
283+
);
284+
}
257285
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace AfriCC\Tests\EPP\Frame\Command\Update;
4+
5+
use AfriCC\EPP\Frame\Command\Update\Host;
6+
use PHPUnit\Framework\TestCase;
7+
8+
class HostUpdateTest extends TestCase
9+
{
10+
public function testUpdateHostFrame()
11+
{
12+
$frame = new Host();
13+
$frame->setHost('ns1.example.com');
14+
$frame->addAddr('1.1.1.1');
15+
$frame->removeAddr('8.8.8.8');
16+
$frame->addAddr('1080:0:0:0:8:800:200C:417A');
17+
$frame->addStatus('clientUpdateProhibited');
18+
$frame->removeStatus('clientTransferProhibited');
19+
$frame->changeHost('ns2.example.com');
20+
21+
$this->assertXmlStringEqualsXmlString(
22+
'
23+
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
24+
<command>
25+
<update>
26+
<host:update xmlns:host="urn:ietf:params:xml:ns:host-1.0">
27+
<host:name>ns1.example.com</host:name>
28+
<host:add>
29+
<host:addr ip="v4">1.1.1.1</host:addr>
30+
<host:addr ip="v6">1080:0:0:0:8:800:200C:417A</host:addr>
31+
<host:status s="clientUpdateProhibited"/>
32+
</host:add>
33+
<host:rem>
34+
<host:addr ip="v4">8.8.8.8</host:addr>
35+
<host:status s="clientTransferProhibited"/>
36+
</host:rem>
37+
<host:chg>
38+
<host:name>ns2.example.com</host:name>
39+
</host:chg>
40+
</host:update>
41+
</update>
42+
</command>
43+
</epp>
44+
',
45+
(string) $frame
46+
);
47+
}
48+
}

0 commit comments

Comments
 (0)