Skip to content
Open
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/.idea
/vendor
composer.lock

.phpunit.result.cache
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: php
php:
- 7.0
- 7.1
- 7.2
- 7.3

install: composer install
script: ./vendor/bin/phpunit --configuration phpunit.xml
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
"issues": "https://github.com/Pitchero/ResellerClub/issues",
"source": "https://github.com/Pitchero/ResellerClub"
},
"config": {
"preferred-install": "dist",
"sort-packages": true
},
"require": {
"php": ">=7.0.0",
"php": ">=7.2.0",
"guzzlehttp/guzzle": "~6.0",
"nesbot/carbon": "~1.20 || ~2.0",
"moneyphp/money": "~3.0"
},
"require-dev": {
"phpunit/phpunit": "^6.4 || ^8.0",
"phpunit/phpunit": "^8.4",
"symfony/var-dumper": "^3.3"
},
"autoload": {
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/ActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ActionTest extends TestCase
*/
private $action;

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand All @@ -25,30 +25,30 @@ protected function setUp()
);
}

public function testItCanGetId()
public function testItCanGetId(): void
{
$this->assertEquals(461331388, $this->action->id());
}

public function testItCanGetType()
public function testItCanGetType(): void
{
$this->assertEquals('Add', $this->action->type());
}

public function testItCanGetTypeDescription()
public function testItCanGetTypeDescription(): void
{
$this->assertEquals(
'Addition of Business Email 1 for testdomainmail.com for 1 month',
$this->action->typeDescription()
);
}

public function testItCanGetStatus()
public function testItCanGetStatus(): void
{
$this->assertEquals('PendingExecution', $this->action->status());
}

public function testItCanGetStatusDescription()
public function testItCanGetStatusDescription(): void
{
$this->assertEquals('The action is pending execution', $this->action->statusDescription());
}
Expand Down
34 changes: 17 additions & 17 deletions tests/unit/AddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AddressTest extends TestCase
*/
private $address;

protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->address = new Address(
Expand All @@ -27,51 +27,51 @@ protected function setUp()
);
}

public function testCompany()
public function testCompany(): void
{
$this->assertInternalType('string', $this->address->company());
$this->assertIsString($this->address->company());
$this->assertEquals('Company Name', $this->address->company());
}

public function testAddressLine1()
public function testAddressLine1(): void
{
$this->assertInternalType('string', $this->address->addressLine1());
$this->assertIsString($this->address->addressLine1());
$this->assertEquals('Address Line 1', $this->address->addressLine1());
}

public function testAddressLine2()
public function testAddressLine2(): void
{
$this->assertInternalType('string', $this->address->addressLine2());
$this->assertIsString($this->address->addressLine2());
$this->assertEquals('Address Line 2', $this->address->addressLine2());
}

public function testAddressLine3()
public function testAddressLine3(): void
{
$this->assertInternalType('string', $this->address->addressLine3());
$this->assertIsString($this->address->addressLine3());
$this->assertEquals('Address Line 3', $this->address->addressLine3());
}

public function testCity()
public function testCity(): void
{
$this->assertInternalType('string', $this->address->city());
$this->assertIsString($this->address->city());
$this->assertEquals('Leeds', $this->address->city());
}

public function testCounty()
public function testCounty(): void
{
$this->assertInternalType('string', $this->address->county());
$this->assertIsString($this->address->county());
$this->assertEquals('West Yorkshire', $this->address->county());
}

public function testCountry()
public function testCountry(): void
{
$this->assertInternalType('string', $this->address->country());
$this->assertIsString($this->address->country());
$this->assertEquals('Gb', $this->address->country());
}

public function testPostCode()
public function testPostCode(): void
{
$this->assertInternalType('string', $this->address->postCode());
$this->assertIsString($this->address->postCode());
$this->assertEquals('LS1 1AB', $this->address->postCode());
}
}
22 changes: 11 additions & 11 deletions tests/unit/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ApiTest extends TestCase
*/
private $api;

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand All @@ -44,17 +44,17 @@ protected function setUp()
);
}

public function testGet()
public function testGet(): void
{
$this->assertInstanceOf(Response::class, $this->api->get('get', ['request-param' => 123]));
}

public function testPost()
public function testPost(): void
{
$this->assertInstanceOf(Response::class, $this->api->post('post', ['request-param' => 123]));
}

public function testApiClientException()
public function testApiClientException(): void
{
$mock = new MockHandler([
new ClientException('a', new Request('POST', 'test')),
Expand All @@ -69,7 +69,7 @@ public function testApiClientException()
$api->post('post', ['request-param' => 123]);
}

public function testConnectionException()
public function testConnectionException(): void
{
$mock = new MockHandler([
new ConnectException('Error Communicating with Server', new Request('POST', 'test')),
Expand All @@ -84,7 +84,7 @@ public function testConnectionException()
$api->post('post', ['request-param' => 123]);
}

public function testAlreadyRenewedException()
public function testAlreadyRenewedException(): void
{
$mock = new MockHandler([
new ServerException('Domain already renewed.', new Request('POST', 'test')),
Expand All @@ -99,7 +99,7 @@ public function testAlreadyRenewedException()
$api->post('post', ['request-param' => 123]);
}

public function testApiException()
public function testApiException(): void
{
$mock = new MockHandler([
new RequestException('Error Communicating with Server', new Request('POST', 'test')),
Expand All @@ -114,22 +114,22 @@ public function testApiException()
$api->post('post', ['request-param' => 123]);
}

public function testBusinessEmailOrder()
public function testBusinessEmailOrder(): void
{
$this->assertInstanceOf(BusinessEmailOrder::class, $this->api->businessEmailOrder());
}

public function testDomainOrder()
public function testDomainOrder(): void
{
$this->assertInstanceOf(DomainOrder::class, $this->api->domainOrder());
}

public function testEmailAccount()
public function testEmailAccount(): void
{
$this->assertInstanceOf(EmailAccount::class, $this->api->emailAccount());
}

public function testEmailForwarder()
public function testEmailForwarder(): void
{
$this->assertInstanceOf(EmailForwarder::class, $this->api->emailForwarder());
}
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ class ConfigTest extends TestCase
*/
private $config;

protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->config = new Config(123, 'api_key');
}

public function testAuthUserId()
public function testAuthUserId(): void
{
$this->assertEquals(123, $this->config->authUserId());
}

public function testApiKey()
public function testApiKey(): void
{
$this->assertEquals('api_key', $this->config->apiKey());
}

public function testIsNotTestMode()
public function testIsNotTestMode(): void
{
$this->assertFalse($this->config->isTestMode());
}

public function testIsTestMode()
public function testIsTestMode(): void
{
$config = new Config(123, 'api_key', true);
$this->assertTrue($config->isTestMode());
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Dns/A/ARecordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class ARecordTest extends TestCase
{
public function testAddInstance()
public function testAddInstance(): void
{
$ARecord = new ARecord($this->api($this->mockResponse()));

Expand All @@ -33,7 +33,7 @@ public function testAddInstance()
$this->assertInstanceOf(AddResponse::class, $ARecord->add($addRequest));
}

public function testUpdateInstance()
public function testUpdateInstance(): void
{
$ARecord = new ARecord($this->api($this->mockResponse()));

Expand Down
22 changes: 11 additions & 11 deletions tests/unit/Dns/A/Requests/AddRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class AddRequestTest extends TestCase
{
public function testInstantiation()
public function testInstantiation(): void
{
$ttl = TimeToLive::defaultTtl();
$request = new AddRequest(
Expand All @@ -22,7 +22,7 @@ public function testInstantiation()
$this->assertInstanceOf(AddRequest::class, $request);
}

public function testInstantiationWithoutTTL()
public function testInstantiationWithoutTTL(): void
{
$request = new AddRequest(
'test.com',
Expand All @@ -33,7 +33,7 @@ public function testInstantiationWithoutTTL()
$this->assertInstanceOf(AddRequest::class, $request);
}

public function testGetters()
public function testGetters(): void
{
$ttl = TimeToLive::defaultTtl();
$request = new AddRequest(
Expand All @@ -43,28 +43,28 @@ public function testGetters()
$ttl
);

$this->assertInternalType('string', $request->domain());
$this->assertInternalType('string', $request->record());
$this->assertIsString($request->domain());
$this->assertIsString($request->record());
$this->assertInstanceOf(IPv4Address::class, $request->value());
$this->assertInstanceOf(TimeToLive::class, $request->ttl());
}

public function testGettersWithoutTTL()
public function testGettersWithoutTTL(): void
{
$request = new AddRequest(
'test.com',
'www',
new IPv4Address('127.0.0.1')
);

$this->assertInternalType('string', $request->domain());
$this->assertInternalType('string', $request->record());
$this->assertIsString($request->domain());
$this->assertIsString($request->record());
$this->assertInstanceOf(IPv4Address::class, $request->value());
$this->assertInstanceOf(TimeToLive::class, $request->ttl());
$this->assertEquals((string) $request->ttl(), TimeToLive::DEFAULT_TTL);
}

public function testGettersWithBlankRecord()
public function testGettersWithBlankRecord(): void
{
$ttl = TimeToLive::defaultTtl();
$request = new AddRequest(
Expand All @@ -74,8 +74,8 @@ public function testGettersWithBlankRecord()
$ttl
);

$this->assertInternalType('string', $request->domain());
$this->assertInternalType('string', $request->record());
$this->assertIsString($request->domain());
$this->assertIsString($request->record());
$this->assertInstanceOf(IPv4Address::class, $request->value());
$this->assertInstanceOf(TimeToLive::class, $request->ttl());
}
Expand Down
Loading