Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmetics #65

Merged
merged 4 commits into from
Oct 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## dev-master - now

### Changes

- Updated code documentation (more contributions welcome)
- Increased testing coverage
- More detailed examples of using this library

### Added

- DNSSec dsData support in Domain classes ( @johnny-bit)
- Introduced `HTTPClient` allowing EPP communication over HTTP(S) (@johnny-bit)
- `AbstractClient` class and `ClientInterface` interface for ease of creating `Client` replacements(@johnny-bit)
- NASK Extension - a full Polish domain registry support

### Fixed

- RFC5733 compatibility enhancements (added `extension` to voice and fax) for Contact calls(@johnny-bit)
- Removed coverage checks from non-testable classes
- Incorrect file permissions (execute bit) on source files

## 1.0.0 - 2018-12-23

### Changes
Expand Down
Empty file modified src/AfriCC/EPP/AbstractFrame.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Extension/NICMX/Info/Rar.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Extension/NICMX/Restore/Domain.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Check.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Check/Domain.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Check/Host.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Create.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Create/Contact.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Create/Domain.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Create/Host.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Delete.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Delete/Contact.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Delete/Domain.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Delete/Host.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Info.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Info/Contact.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Info/Domain.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Info/Host.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Login.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Poll.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Renew.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Renew/Domain.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Transfer.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Transfer/Contact.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Transfer/Domain.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Update.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Update/Contact.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Command/Update/Host.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Greeting.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Hello.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/Frame/Response.php
100755 → 100644
Empty file.
Empty file modified src/AfriCC/EPP/ObjectSpec.php
100755 → 100644
Empty file.
4 changes: 4 additions & 0 deletions src/AfriCC/EPP/Random.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ public static function id($max_length = 64, $prefix = '')
*/
public static function auth($len)
{
// All code bellow does the same - generate as safe as possible random string
// no need for full coverage test ;)
// @codeCoverageIgnoreStart
if (function_exists('random_bytes')) {
$randomBytes = random_bytes($len);
} elseif (function_exists('openssl_random_pseudo_bytes')) {
$randomBytes = openssl_random_pseudo_bytes($len);
} else {
$randomBytes = mcrypt_create_iv($len, MCRYPT_DEV_URANDOM);
}
// @codeCoverageIgnoreEnd

$randomBytes = base64_encode($randomBytes);

Expand Down
37 changes: 36 additions & 1 deletion tests/EPP/Frame/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace AfriCC\Tests\EPP\Frame;

use AfriCC\EPP\Frame\Response;
use AfriCC\EPP\Frame\Response\MessageQueue;
use AfriCC\EPP\Frame\ResponseFactory;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -224,4 +223,40 @@ public function testResponseFailure()
$this->assertNull($response->clientTransactionId());
$this->assertNull($response->serverTransactionId());
}

public function testInvalidResponse()
{
$not_found = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>404 Not Found</title></head>
<body> Requested resource was not found</body>
</html>';
$response = ResponseFactory::build($not_found);

$this->assertEquals($response, $not_found);
}

public function testEmptyResponse()
{
$empty_epp = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
</epp>';
$response = ResponseFactory::build($empty_epp);

$this->assertEquals($response, $empty_epp);
}

public function testWeirdResponse()
{
$empty_epp = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<invalid>
invalid_request
</invalid>
</epp>';
$response = ResponseFactory::build($empty_epp);

$this->assertEquals($response, $empty_epp);
}
}