Skip to content

Commit

Permalink
prepare for 1.0.0 (#60)
Browse files Browse the repository at this point in the history
* prepare for 1.0.0

* fixes #54
  • Loading branch information
lifeofguenter authored Dec 23, 2018
1 parent 6a8c285 commit 9ceb137
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 1 deletion.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 1.0.0 - 2018-12-23

### Changes

- response will always be a result-array (_breaking_)

### Added

- `verify_peer_name` option (thx @panaceya)

### Fixed

- cz-nic (thx @krtcom)
- php 7.2+ compat (thx @krtcom)

## 0.3.1 - 2017-04-27

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/AfriCC/EPP/AbstractFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function set($path = null, $value = null)
}

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

return $this->nodes[$path];
Expand Down
28 changes: 28 additions & 0 deletions tests/EPP/Frame/Command/Create/ContactCreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,32 @@ public function testContactCreateDiscloseFrame()
(string) $frame
);
}

public function testContactCreateEntities()
{
$frame = new Contact();
$frame->setId('CONTACT1');
$frame->setOrganization('Fäther & Sons"');

$this->assertXmlStringEqualsXmlString(
'
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<create>
<contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
<contact:id>CONTACT1</contact:id>
<contact:postalInfo type="loc">
<contact:org>Fäther &amp; Sons"</contact:org>
</contact:postalInfo>
<contact:postalInfo type="int">
<contact:org>Father &amp; Sons"</contact:org>
</contact:postalInfo>
</contact:create>
</create>
</command>
</epp>
',
(string) $frame
);
}
}
48 changes: 48 additions & 0 deletions tests/EPP/Frame/Command/Update/HostUpdateTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace AfriCC\Tests\EPP\Frame\Command\Update;

use AfriCC\EPP\Frame\Command\Update\Host;
use PHPUnit\Framework\TestCase;

class HostUpdateTest extends TestCase
{
public function testUpdateHostFrame()
{
$frame = new Host();
$frame->setHost('ns1.example.com');
$frame->addAddr('1.1.1.1');
$frame->removeAddr('8.8.8.8');
$frame->addAddr('1080:0:0:0:8:800:200C:417A');
$frame->addStatus('clientUpdateProhibited');
$frame->removeStatus('clientTransferProhibited');
$frame->changeHost('ns2.example.com');

$this->assertXmlStringEqualsXmlString(
'
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<update>
<host:update xmlns:host="urn:ietf:params:xml:ns:host-1.0">
<host:name>ns1.example.com</host:name>
<host:add>
<host:addr ip="v4">1.1.1.1</host:addr>
<host:addr ip="v6">1080:0:0:0:8:800:200C:417A</host:addr>
<host:status s="clientUpdateProhibited"/>
</host:add>
<host:rem>
<host:addr ip="v4">8.8.8.8</host:addr>
<host:status s="clientTransferProhibited"/>
</host:rem>
<host:chg>
<host:name>ns2.example.com</host:name>
</host:chg>
</host:update>
</update>
</command>
</epp>
',
(string) $frame
);
}
}

0 comments on commit 9ceb137

Please sign in to comment.