From 3e3239cb690057676435e6e859fb95299e0934bd Mon Sep 17 00:00:00 2001 From: Robert Rosebury Date: Fri, 11 Oct 2019 16:47:27 +0100 Subject: [PATCH] [Feature] Upgraded PHPUnit to 8.4 - Updated the unit tests to have return type of void - Replaced usages of assertInternalType() due to deprecation - Changed the minimum PHP version to 7.2 --- .gitignore | 2 +- .travis.yml | 4 +- composer.json | 8 +- tests/unit/ActionTest.php | 12 +- tests/unit/AddressTest.php | 34 +-- tests/unit/ApiTest.php | 22 +- tests/unit/ConfigTest.php | 10 +- tests/unit/Dns/A/ARecordTest.php | 4 +- tests/unit/Dns/A/Requests/AddRequestTest.php | 22 +- .../unit/Dns/A/Requests/UpdateRequestTest.php | 16 +- tests/unit/Dns/Cname/CnameRecordTest.php | 4 +- .../Dns/Cname/Requests/AddRequestTest.php | 20 +- .../Dns/Cname/Requests/UpdateRequestTest.php | 22 +- tests/unit/EmailAddressTest.php | 4 +- tests/unit/ExceptionMapperTest.php | 16 +- tests/unit/IPv4AddressTest.php | 8 +- tests/unit/MessageTest.php | 2 +- .../BusinessEmails/BusinessEmailOrderTest.php | 10 +- .../Requests/AddEmailAccountRequestTest.php | 6 +- .../BusinessEmailOrderRequestTest.php | 16 +- .../DeleteEmailAccountRequestTest.php | 6 +- .../Requests/RenewRequestTest.php | 10 +- .../AddedEmailAccountResponseFactoryTest.php | 8 +- .../AddedEmailAccountResponseTest.php | 24 +-- .../BusinessEmailOrderResponseTest.php | 8 +- .../Responses/CreateResponseTest.php | 26 +-- .../DeletedEmailAccountResponseTest.php | 10 +- .../Responses/GetResponseTest.php | 106 +++++----- .../Responses/RenewalResponseTest.php | 28 +-- tests/unit/Orders/ContactTest.php | 24 +-- .../Orders/Domains/DelegationSignerTest.php | 10 +- .../Domains/DomainOrderDetailTypeTest.php | 2 +- tests/unit/Orders/Domains/DomainOrderTest.php | 6 +- .../unit/Orders/Domains/NamedServersTest.php | 10 +- .../Orders/Domains/PrivacyProtectionTest.php | 10 +- .../RegistrantContactVerificationTest.php | 8 +- .../Orders/Domains/RegistryStatusTest.php | 10 +- .../Domains/Requests/GetRequestTest.php | 6 +- .../Requests/GetbyDomainRequestTest.php | 6 +- .../Domains/Requests/RenewRequestTest.php | 26 +-- .../Domains/Responses/GetResponseTest.php | 200 +++++++++--------- .../PrivacyProtectionOrderResponseTest.php | 22 +- .../Domains/Responses/RenewalResponseTest.php | 22 +- .../Orders/EmailAccounts/EmailAccountTest.php | 4 +- .../Requests/CreateRequestTest.php | 18 +- .../Requests/DeleteRequestTest.php | 6 +- .../Responses/CreateResponseTest.php | 86 ++++---- .../Responses/DeletedResponseTest.php | 8 +- .../Settings/ImapSettingsTest.php | 2 +- .../Settings/PopSettingsTest.php | 2 +- .../Settings/SmtpSettingsTest.php | 2 +- .../Settings/WebmailUrlSettingsTest.php | 2 +- .../EmailForwarders/EmailForwarderTest.php | 2 +- .../Requests/CreateRequestTest.php | 8 +- .../Responses/CreateResponseTest.php | 4 +- tests/unit/Orders/GdprProtectionTest.php | 4 +- tests/unit/Orders/InvoiceOptionTest.php | 2 +- tests/unit/Orders/LockedOrHoldStatusTest.php | 8 +- tests/unit/Orders/OrderStatusTest.php | 12 +- tests/unit/Orders/OrderTest.php | 4 +- tests/unit/ResponseTest.php | 6 +- tests/unit/StatusTest.php | 2 +- tests/unit/TelephoneNumberTest.php | 16 +- tests/unit/TimeToLiveTest.php | 18 +- 64 files changed, 525 insertions(+), 521 deletions(-) diff --git a/.gitignore b/.gitignore index adacc5e..62ead3c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /.idea /vendor composer.lock - +.phpunit.result.cache \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index b50f2d1..0dabb52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/composer.json b/composer.json index d4eec6e..bf6deb5 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/tests/unit/ActionTest.php b/tests/unit/ActionTest.php index c2c2dba..f62030c 100644 --- a/tests/unit/ActionTest.php +++ b/tests/unit/ActionTest.php @@ -12,7 +12,7 @@ class ActionTest extends TestCase */ private $action; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -25,17 +25,17 @@ 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', @@ -43,12 +43,12 @@ public function testItCanGetTypeDescription() ); } - 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()); } diff --git a/tests/unit/AddressTest.php b/tests/unit/AddressTest.php index b60d958..5804cb2 100644 --- a/tests/unit/AddressTest.php +++ b/tests/unit/AddressTest.php @@ -12,7 +12,7 @@ class AddressTest extends TestCase */ private $address; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->address = new Address( @@ -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()); } } diff --git a/tests/unit/ApiTest.php b/tests/unit/ApiTest.php index 82b90a4..aab3c8f 100644 --- a/tests/unit/ApiTest.php +++ b/tests/unit/ApiTest.php @@ -30,7 +30,7 @@ class ApiTest extends TestCase */ private $api; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -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')), @@ -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')), @@ -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')), @@ -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')), @@ -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()); } diff --git a/tests/unit/ConfigTest.php b/tests/unit/ConfigTest.php index e05ba0c..aa53215 100644 --- a/tests/unit/ConfigTest.php +++ b/tests/unit/ConfigTest.php @@ -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()); diff --git a/tests/unit/Dns/A/ARecordTest.php b/tests/unit/Dns/A/ARecordTest.php index 8855211..b105b8b 100644 --- a/tests/unit/Dns/A/ARecordTest.php +++ b/tests/unit/Dns/A/ARecordTest.php @@ -19,7 +19,7 @@ class ARecordTest extends TestCase { - public function testAddInstance() + public function testAddInstance(): void { $ARecord = new ARecord($this->api($this->mockResponse())); @@ -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())); diff --git a/tests/unit/Dns/A/Requests/AddRequestTest.php b/tests/unit/Dns/A/Requests/AddRequestTest.php index 5328392..47c5053 100644 --- a/tests/unit/Dns/A/Requests/AddRequestTest.php +++ b/tests/unit/Dns/A/Requests/AddRequestTest.php @@ -9,7 +9,7 @@ class AddRequestTest extends TestCase { - public function testInstantiation() + public function testInstantiation(): void { $ttl = TimeToLive::defaultTtl(); $request = new AddRequest( @@ -22,7 +22,7 @@ public function testInstantiation() $this->assertInstanceOf(AddRequest::class, $request); } - public function testInstantiationWithoutTTL() + public function testInstantiationWithoutTTL(): void { $request = new AddRequest( 'test.com', @@ -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( @@ -43,13 +43,13 @@ 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', @@ -57,14 +57,14 @@ public function testGettersWithoutTTL() 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( @@ -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()); } diff --git a/tests/unit/Dns/A/Requests/UpdateRequestTest.php b/tests/unit/Dns/A/Requests/UpdateRequestTest.php index 6d8f0a4..f55bf67 100644 --- a/tests/unit/Dns/A/Requests/UpdateRequestTest.php +++ b/tests/unit/Dns/A/Requests/UpdateRequestTest.php @@ -9,7 +9,7 @@ class UpdateRequestTest extends TestCase { - public function testInstantiation() + public function testInstantiation(): void { $ttl = TimeToLive::defaultTtl(); $request = new UpdateRequest( @@ -23,7 +23,7 @@ public function testInstantiation() $this->assertInstanceOf(UpdateRequest::class, $request); } - public function testInstantiationWithoutTTL() + public function testInstantiationWithoutTTL(): void { $request = new UpdateRequest( 'test.com', @@ -35,7 +35,7 @@ public function testInstantiationWithoutTTL() $this->assertInstanceOf(UpdateRequest::class, $request); } - public function testGetters() + public function testGetters(): void { $ttl = TimeToLive::defaultTtl(); $request = new UpdateRequest( @@ -46,14 +46,14 @@ 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->currentValue()); $this->assertInstanceOf(IPv4Address::class, $request->newValue()); $this->assertInstanceOf(TimeToLive::class, $request->ttl()); } - public function testGettersWithoutTTL() + public function testGettersWithoutTTL(): void { $request = new UpdateRequest( 'test.com', @@ -62,8 +62,8 @@ public function testGettersWithoutTTL() new IPv4Address('192.168.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->currentValue()); $this->assertInstanceOf(IPv4Address::class, $request->newValue()); $this->assertInstanceOf(TimeToLive::class, $request->ttl()); diff --git a/tests/unit/Dns/Cname/CnameRecordTest.php b/tests/unit/Dns/Cname/CnameRecordTest.php index 2031dbd..bc75b22 100644 --- a/tests/unit/Dns/Cname/CnameRecordTest.php +++ b/tests/unit/Dns/Cname/CnameRecordTest.php @@ -18,7 +18,7 @@ class CnameRecordTest extends TestCase { - public function testAddInstance() + public function testAddInstance(): void { $cnameRecord = new CnameRecord($this->api($this->mockResponse())); @@ -32,7 +32,7 @@ public function testAddInstance() $this->assertInstanceOf(AddResponse::class, $cnameRecord->add($addRequest)); } - public function testUpdateInstance() + public function testUpdateInstance(): void { $cnameRecord = new CnameRecord($this->api($this->mockResponse())); diff --git a/tests/unit/Dns/Cname/Requests/AddRequestTest.php b/tests/unit/Dns/Cname/Requests/AddRequestTest.php index c3c469f..f0d0f72 100644 --- a/tests/unit/Dns/Cname/Requests/AddRequestTest.php +++ b/tests/unit/Dns/Cname/Requests/AddRequestTest.php @@ -8,7 +8,7 @@ class AddRequestTest extends TestCase { - public function testInstantiation() + public function testInstantiation(): void { $ttl = TimeToLive::defaultTtl(); $request = new AddRequest( @@ -21,7 +21,7 @@ public function testInstantiation() $this->assertInstanceOf(AddRequest::class, $request); } - public function testInstantiationWithoutTTL() + public function testInstantiationWithoutTTL(): void { $request = new AddRequest( 'test.com', @@ -32,7 +32,7 @@ public function testInstantiationWithoutTTL() $this->assertInstanceOf(AddRequest::class, $request); } - public function testGetters() + public function testGetters(): void { $ttl = TimeToLive::defaultTtl(); $request = new AddRequest( @@ -42,13 +42,13 @@ public function testGetters() $ttl ); - $this->assertInternalType('string', $request->domain()); - $this->assertInternalType('string', $request->record()); - $this->assertInternalType('string', $request->value()); + $this->assertIsString($request->domain()); + $this->assertIsString($request->record()); + $this->assertIsString($request->value()); $this->assertInstanceOf(TimeToLive::class, $request->ttl()); } - public function testGettersWithoutTTL() + public function testGettersWithoutTTL(): void { $request = new AddRequest( 'test.com', @@ -56,9 +56,9 @@ public function testGettersWithoutTTL() 'cname.new.com' ); - $this->assertInternalType('string', $request->domain()); - $this->assertInternalType('string', $request->record()); - $this->assertInternalType('string', $request->value()); + $this->assertIsString($request->domain()); + $this->assertIsString($request->record()); + $this->assertIsString($request->value()); $this->assertInstanceOf(TimeToLive::class, $request->ttl()); $this->assertEquals((string) $request->ttl(), TimeToLive::DEFAULT_TTL); } diff --git a/tests/unit/Dns/Cname/Requests/UpdateRequestTest.php b/tests/unit/Dns/Cname/Requests/UpdateRequestTest.php index 1214b97..0aaa15f 100644 --- a/tests/unit/Dns/Cname/Requests/UpdateRequestTest.php +++ b/tests/unit/Dns/Cname/Requests/UpdateRequestTest.php @@ -8,7 +8,7 @@ class UpdateRequestTest extends TestCase { - public function testInstantiation() + public function testInstantiation(): void { $ttl = TimeToLive::defaultTtl(); $request = new UpdateRequest( @@ -22,7 +22,7 @@ public function testInstantiation() $this->assertInstanceOf(UpdateRequest::class, $request); } - public function testInstantiationWithoutTTL() + public function testInstantiationWithoutTTL(): void { $request = new UpdateRequest( 'test.com', @@ -45,14 +45,14 @@ public function testGetters() $ttl ); - $this->assertInternalType('string', $request->domain()); - $this->assertInternalType('string', $request->record()); - $this->assertInternalType('string', $request->currentValue()); - $this->assertInternalType('string', $request->newValue()); + $this->assertIsString($request->domain()); + $this->assertIsString($request->record()); + $this->assertIsString($request->currentValue()); + $this->assertIsString($request->newValue()); $this->assertInstanceOf(TimeToLive::class, $request->ttl()); } - public function testGettersWithoutTTL() + public function testGettersWithoutTTL(): void { $request = new UpdateRequest( 'test.com', @@ -61,10 +61,10 @@ public function testGettersWithoutTTL() 'cname.new.com' ); - $this->assertInternalType('string', $request->domain()); - $this->assertInternalType('string', $request->record()); - $this->assertInternalType('string', $request->currentValue()); - $this->assertInternalType('string', $request->newValue()); + $this->assertIsString($request->domain()); + $this->assertIsString($request->record()); + $this->assertIsString($request->currentValue()); + $this->assertIsString($request->newValue()); $this->assertInstanceOf(TimeToLive::class, $request->ttl()); $this->assertEquals((string) $request->ttl(), TimeToLive::DEFAULT_TTL); } diff --git a/tests/unit/EmailAddressTest.php b/tests/unit/EmailAddressTest.php index 35a3d88..da1ed70 100644 --- a/tests/unit/EmailAddressTest.php +++ b/tests/unit/EmailAddressTest.php @@ -8,14 +8,14 @@ class EmailAddressTest extends TestCase { - public function testCanCreateNewInstance() + public function testCanCreateNewInstance(): void { $email = new EmailAddress('steve@apple.com'); $this->assertEquals('steve@apple.com', (string) $email); } - public function testInvalidEmailAddressThrowsException() + public function testInvalidEmailAddressThrowsException(): void { $this->expectException(InvalidArgumentException::class); diff --git a/tests/unit/ExceptionMapperTest.php b/tests/unit/ExceptionMapperTest.php index 509f818..25965ff 100644 --- a/tests/unit/ExceptionMapperTest.php +++ b/tests/unit/ExceptionMapperTest.php @@ -24,13 +24,13 @@ class ExceptionMapperTest extends TestCase */ private $request; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->request = new Request('GET', 'https://test'); } - public function testApiClientException() + public function testApiClientException(): void { $expectedMessage = 'Authentication failure'; $expectedCode = 400; @@ -49,7 +49,7 @@ public function testApiClientException() $this->assertEquals($expectedMessage, $exception->getMessage()); } - public function testConnectionException() + public function testConnectionException(): void { $expectedMessage = 'Authentication failure'; @@ -66,7 +66,7 @@ public function testConnectionException() $this->assertEquals($expectedMessage, $exception->getMessage()); } - public function testApiException() + public function testApiException(): void { $expectedMessage = 'Some base message.'; $expectedCode = 500; @@ -85,7 +85,7 @@ public function testApiException() $this->assertEquals($expectedMessage, $exception->getMessage()); } - public function testAlreadyRenewedException() + public function testAlreadyRenewedException(): void { $expectedMessage = 'Domain already renewed.'; $expectedCode = 500; @@ -104,7 +104,7 @@ public function testAlreadyRenewedException() $this->assertEquals($expectedMessage, $exception->getMessage()); } - public function testActionPendingException() + public function testActionPendingException(): void { $expectedMessage = 'There is already an action pending on this Order.'; $expectedCode = 500; @@ -123,7 +123,7 @@ public function testActionPendingException() $this->assertEquals($expectedMessage, $exception->getMessage()); } - public function testMinimumRequirementException() + public function testMinimumRequirementException(): void { $expectedMessage = 'You must have atleast ONE email account.'; $expectedCode = 500; @@ -142,7 +142,7 @@ public function testMinimumRequirementException() $this->assertEquals($expectedMessage, $exception->getMessage()); } - private function response($expectedCode, $expectedMessage) + private function response($expectedCode, $expectedMessage): Response { return new Response($expectedCode, [], json_encode(['status' => 'Error', 'message' => $expectedMessage])); } diff --git a/tests/unit/IPv4AddressTest.php b/tests/unit/IPv4AddressTest.php index 153af71..f873ac3 100644 --- a/tests/unit/IPv4AddressTest.php +++ b/tests/unit/IPv4AddressTest.php @@ -8,14 +8,14 @@ class IPv4AddressTest extends TestCase { - public function testCanCreateNewInstance() + public function testCanCreateNewInstance(): void { $address = new IPv4Address('127.0.0.1'); $this->assertEquals('127.0.0.1', (string) $address); } - public function testInvalidIPv4AddressThrowsException() + public function testInvalidIPv4AddressThrowsException(): void { $this->expectException(InvalidArgumentException::class); @@ -25,7 +25,7 @@ public function testInvalidIPv4AddressThrowsException() new IPv4Address('127.0.0'); } - public function testInvalidIPv4AddressThrowsException2() + public function testInvalidIPv4AddressThrowsException2(): void { $this->expectException(InvalidArgumentException::class); @@ -35,7 +35,7 @@ public function testInvalidIPv4AddressThrowsException2() new IPv4Address('127.0.0.0.1'); } - public function testInvalidIPv4AddressThrowsException3() + public function testInvalidIPv4AddressThrowsException3(): void { $this->expectException(InvalidArgumentException::class); diff --git a/tests/unit/MessageTest.php b/tests/unit/MessageTest.php index 9f63d8a..964096d 100644 --- a/tests/unit/MessageTest.php +++ b/tests/unit/MessageTest.php @@ -7,7 +7,7 @@ class MessageTest extends TestCase { - public function testMessageReturnsCorrectString() + public function testMessageReturnsCorrectString(): void { $this->assertEquals('This is the message', (string) new Message('This is the message')); } diff --git a/tests/unit/Orders/BusinessEmails/BusinessEmailOrderTest.php b/tests/unit/Orders/BusinessEmails/BusinessEmailOrderTest.php index b5dd4fe..9d28c33 100644 --- a/tests/unit/Orders/BusinessEmails/BusinessEmailOrderTest.php +++ b/tests/unit/Orders/BusinessEmails/BusinessEmailOrderTest.php @@ -23,7 +23,7 @@ class BusinessEmailOrderTest extends TestCase { - public function testResponseFromBusinessEmailOrderCreate() + public function testResponseFromBusinessEmailOrderCreate(): void { $mock = new MockHandler([ new Response( @@ -62,7 +62,7 @@ public function testResponseFromBusinessEmailOrderCreate() ); } - public function testResponseFromBusinessEmailOrderDelete() + public function testResponseFromBusinessEmailOrderDelete(): void { $mock = new MockHandler([ new Response( @@ -90,7 +90,7 @@ public function testResponseFromBusinessEmailOrderDelete() ); } - public function testResponseFromBusinessEmailOrderGet() + public function testResponseFromBusinessEmailOrderGet(): void { $mock = new MockHandler([ new Response( @@ -138,7 +138,7 @@ public function testResponseFromBusinessEmailOrderGet() ); } - public function testResponseFromBusinessEmailOrderAddEmailAccount() + public function testResponseFromBusinessEmailOrderAddEmailAccount(): void { $mock = new MockHandler([ new Response( @@ -178,7 +178,7 @@ public function testResponseFromBusinessEmailOrderAddEmailAccount() ); } - public function testResponseFromBusinessEmailOrderDeleteEmailAccount() + public function testResponseFromBusinessEmailOrderDeleteEmailAccount(): void { $mock = new MockHandler([ new Response( diff --git a/tests/unit/Orders/BusinessEmails/Requests/AddEmailAccountRequestTest.php b/tests/unit/Orders/BusinessEmails/Requests/AddEmailAccountRequestTest.php index 873d091..e63de75 100644 --- a/tests/unit/Orders/BusinessEmails/Requests/AddEmailAccountRequestTest.php +++ b/tests/unit/Orders/BusinessEmails/Requests/AddEmailAccountRequestTest.php @@ -14,7 +14,7 @@ class AddEmailAccountRequestTest extends TestCase */ private $request; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -29,12 +29,12 @@ protected function setUp() ); } - public function testItCanGetOrderId() + public function testItCanGetOrderId(): void { $this->assertEquals(123, $this->request->orderId()); } - public function testItCanGetNumberOfAccounts() + public function testItCanGetNumberOfAccounts(): void { $this->assertEquals(1, $this->request->numberOfAccounts()); } diff --git a/tests/unit/Orders/BusinessEmails/Requests/BusinessEmailOrderRequestTest.php b/tests/unit/Orders/BusinessEmails/Requests/BusinessEmailOrderRequestTest.php index 679a724..cd00c11 100644 --- a/tests/unit/Orders/BusinessEmails/Requests/BusinessEmailOrderRequestTest.php +++ b/tests/unit/Orders/BusinessEmails/Requests/BusinessEmailOrderRequestTest.php @@ -13,7 +13,7 @@ class BusinessEmailOrderRequestTest extends TestCase */ private $businessEmailOrder; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -26,30 +26,30 @@ protected function setUp() ); } - public function testCustomerId() + public function testCustomerId(): void { $customerId = $this->businessEmailOrder->customerId(); - $this->assertInternalType('int', $customerId); + $this->assertIsInt($customerId); $this->assertEquals(123, $customerId); } - public function testDomainName() + public function testDomainName(): void { $this->assertEquals('some-domain.co.uk', $this->businessEmailOrder->domain()); } - public function testNumberOfAccounts() + public function testNumberOfAccounts(): void { $numberOfAccounts = $this->businessEmailOrder->numberOfAccounts(); - $this->assertInternalType('int', $numberOfAccounts); + $this->assertIsInt($numberOfAccounts); $this->assertEquals(5, $numberOfAccounts); } - public function testForNumberOfMonths() + public function testForNumberOfMonths(): void { $forNumberOfMonths = $this->businessEmailOrder->forNumberOfMonths(); - $this->assertInternalType('int', $forNumberOfMonths); + $this->assertIsInt($forNumberOfMonths); $this->assertEquals(1, $forNumberOfMonths); } diff --git a/tests/unit/Orders/BusinessEmails/Requests/DeleteEmailAccountRequestTest.php b/tests/unit/Orders/BusinessEmails/Requests/DeleteEmailAccountRequestTest.php index 760afed..9edf086 100644 --- a/tests/unit/Orders/BusinessEmails/Requests/DeleteEmailAccountRequestTest.php +++ b/tests/unit/Orders/BusinessEmails/Requests/DeleteEmailAccountRequestTest.php @@ -13,7 +13,7 @@ class DeleteEmailAccountRequestTest extends TestCase */ private $request; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -25,12 +25,12 @@ protected function setUp() ); } - public function testItCanGetOrderId() + public function testItCanGetOrderId(): void { $this->assertEquals(123, $this->request->orderId()); } - public function testItCanGetNumberOfAccounts() + public function testItCanGetNumberOfAccounts(): void { $this->assertEquals(1, $this->request->numberOfAccounts()); } diff --git a/tests/unit/Orders/BusinessEmails/Requests/RenewRequestTest.php b/tests/unit/Orders/BusinessEmails/Requests/RenewRequestTest.php index 56a7eff..c775e48 100644 --- a/tests/unit/Orders/BusinessEmails/Requests/RenewRequestTest.php +++ b/tests/unit/Orders/BusinessEmails/Requests/RenewRequestTest.php @@ -14,7 +14,7 @@ class RenewRequestTest extends TestCase */ private $request; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -30,22 +30,22 @@ protected function setUp() ); } - public function testItCanGetOrderId() + public function testItCanGetOrderId(): void { $this->assertEquals(123, $this->request->orderId()); } - public function testItCanGetMonths() + public function testItCanGetMonths(): void { $this->assertEquals(3, $this->request->months()); } - public function testItCanGetNumberOfAccounts() + public function testItCanGetNumberOfAccounts(): void { $this->assertEquals(0, $this->request->numberOfAccounts()); } - public function testItCanGetInvoiceOption() + public function testItCanGetInvoiceOption(): void { $this->assertInstanceOf(InvoiceOption::class, $this->request->invoiceOption()); $this->assertEquals('NoInvoice', (string) $this->request->invoiceOption()); diff --git a/tests/unit/Orders/BusinessEmails/Responses/AddedEmailAccountResponseFactoryTest.php b/tests/unit/Orders/BusinessEmails/Responses/AddedEmailAccountResponseFactoryTest.php index c6cffb4..b233a08 100644 --- a/tests/unit/Orders/BusinessEmails/Responses/AddedEmailAccountResponseFactoryTest.php +++ b/tests/unit/Orders/BusinessEmails/Responses/AddedEmailAccountResponseFactoryTest.php @@ -9,7 +9,7 @@ class AddedEmailAccountResponseFactoryTest extends TestCase { - public function testPayInvoiceResponse() + public function testPayInvoiceResponse(): void { $responseBody = [ 'actionstatusdesc' => 'Request will be processed in some time.', @@ -42,7 +42,7 @@ public function testPayInvoiceResponse() } } - public function testKeepInvoiceResponse() + public function testKeepInvoiceResponse(): void { $responseBody = [ 'actionstatusdesc' => 'Request will be processed in some time.', @@ -75,7 +75,7 @@ public function testKeepInvoiceResponse() } } - public function testOnlyAddResponse() + public function testOnlyAddResponse(): void { $responseBody = [ 'customercost' => '90.54', @@ -99,7 +99,7 @@ public function testOnlyAddResponse() } } - public function testNoInvoiceResponse() + public function testNoInvoiceResponse(): void { $responseBody = [ 'entityid' => '80064711', diff --git a/tests/unit/Orders/BusinessEmails/Responses/AddedEmailAccountResponseTest.php b/tests/unit/Orders/BusinessEmails/Responses/AddedEmailAccountResponseTest.php index a778b2e..149a558 100644 --- a/tests/unit/Orders/BusinessEmails/Responses/AddedEmailAccountResponseTest.php +++ b/tests/unit/Orders/BusinessEmails/Responses/AddedEmailAccountResponseTest.php @@ -16,7 +16,7 @@ class AddedEmailAccountResponseTest extends TestCase */ private $response; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -38,7 +38,7 @@ protected function setUp() ]); } - public function testItCanGetAction() + public function testItCanGetAction(): void { $this->assertInstanceOf(Action::class, $this->response->action()); $this->assertEquals(469754540, $this->response->action()->id()); @@ -51,55 +51,55 @@ public function testItCanGetAction() $this->assertEquals('Request will be processed in some time.', $this->response->action()->statusDescription()); } - public function testItCanGetEntityId() + public function testItCanGetEntityId(): void { $this->assertEquals(80030154, $this->response->entityId()); } - public function testItCanGetDomain() + public function testItCanGetDomain(): void { $this->assertEquals('test-domain.co.uk.onlyfordemo.com', $this->response->domain()); } - public function testItCanGetStatus() + public function testItCanGetStatus(): void { $this->assertInstanceOf(Status::class, $this->response->status()); $this->assertEquals('success', (string) $this->response->status()); } - public function testItCanGetInvoiceId() + public function testItCanGetInvoiceId(): void { $this->assertEquals(78877737, $this->response->invoiceId()); } - public function testItCanGetCustomerId() + public function testItCanGetCustomerId(): void { $this->assertEquals(17824872, $this->response->customerId()); } - public function testItCanGetSellingCurrencySymbol() + public function testItCanGetSellingCurrencySymbol(): void { $this->assertEquals('GBP', $this->response->sellingCurrencySymbol()); } - public function testItCanGetSellingCurrency() + public function testItCanGetSellingCurrency(): void { $this->assertInstanceOf(Currency::class, $this->response->sellingCurrency()); } - public function testItCanGetSellingAmount() + public function testItCanGetSellingAmount(): void { $this->assertInstanceOf(Money::class, $this->response->sellingAmount()); $this->assertEquals('-9054', $this->response->sellingAmount()->getAmount()); } - public function testItCanGetUnutilisedSellingAmount() + public function testItCanGetUnutilisedSellingAmount(): void { $this->assertInstanceOf(Money::class, $this->response->unutilisedSellingAmount()); $this->assertEquals('-9054', $this->response->unutilisedSellingAmount()->getAmount()); } - public function testItCanGetCustomerCost() + public function testItCanGetCustomerCost(): void { $this->assertInstanceOf(Money::class, $this->response->customerCost()); $this->assertEquals('9054', $this->response->customerCost()->getAmount()); diff --git a/tests/unit/Orders/BusinessEmails/Responses/BusinessEmailOrderResponseTest.php b/tests/unit/Orders/BusinessEmails/Responses/BusinessEmailOrderResponseTest.php index cb161a8..30da8be 100644 --- a/tests/unit/Orders/BusinessEmails/Responses/BusinessEmailOrderResponseTest.php +++ b/tests/unit/Orders/BusinessEmails/Responses/BusinessEmailOrderResponseTest.php @@ -13,7 +13,7 @@ class BusinessEmailOrderResponseTest extends TestCase */ private $response; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -28,17 +28,17 @@ protected function setUp() ]); } - public function testItCanGetDomain() + public function testItCanGetDomain(): void { $this->assertEquals('some-domain.co.in', $this->response->domain()); } - public function testItCanGetOrderId() + public function testItCanGetOrderId(): void { $this->assertEquals(1234, $this->response->orderId()); } - public function testItCanGetAction() + public function testItCanGetAction(): void { $this->assertInstanceOf(Action::class, $this->response->action()); } diff --git a/tests/unit/Orders/BusinessEmails/Responses/CreateResponseTest.php b/tests/unit/Orders/BusinessEmails/Responses/CreateResponseTest.php index c76f10b..3409932 100644 --- a/tests/unit/Orders/BusinessEmails/Responses/CreateResponseTest.php +++ b/tests/unit/Orders/BusinessEmails/Responses/CreateResponseTest.php @@ -15,39 +15,39 @@ class CreateResponseTest extends TestCase */ private $response; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->response = $this->createResponse(); } - public function testOrderId() + public function testOrderId(): void { $this->assertEquals(79767882, $this->response->orderId()); } - public function testDomain() + public function testDomain(): void { $this->assertEquals('test-domain.co.uk.onlyfordemo.com', $this->response->domain()); } - public function testItCanGetAction() + public function testItCanGetAction(): void { $this->assertInstanceOf(Action::class, $this->response->action()); } - public function testInvoiceId() + public function testInvoiceId(): void { $this->assertEquals(77433277, $this->response->invoiceId()); } - public function testSellingCurrencySymbol() + public function testSellingCurrencySymbol(): void { $this->assertEquals('GBP', $this->response->sellingCurrencySymbol()); } - public function testSellingCurrency() + public function testSellingCurrency(): void { $this->assertInstanceOf(Currency::class, $this->response->sellingCurrency()); $this->assertEquals('GBP', $this->response->sellingCurrency()); @@ -56,7 +56,7 @@ public function testSellingCurrency() /** * @dataProvider sellingAmountProvider */ - public function testSellingAmount($response, $expectedAmount) + public function testSellingAmount($response, $expectedAmount): void { $this->assertInstanceOf(Money::class, $response->sellingAmount()); $this->assertEquals($expectedAmount, $response->sellingAmount()->getAmount()); @@ -65,18 +65,18 @@ public function testSellingAmount($response, $expectedAmount) /** * @dataProvider transactionAmountProvider */ - public function testTransactionAmount($response, $expectedAmount) + public function testTransactionAmount($response, $expectedAmount): void { $this->assertInstanceOf(Money::class, $response->transactionAmount()); $this->assertEquals($expectedAmount, $response->transactionAmount()->getAmount()); } - public function testCustomerId() + public function testCustomerId(): void { $this->assertEquals(17824872, $this->response->customerId()); } - public function sellingAmountProvider() + public function sellingAmountProvider(): array { return [ [ @@ -94,7 +94,7 @@ public function sellingAmountProvider() ]; } - public function transactionAmountProvider() + public function transactionAmountProvider(): array { return [ [ @@ -112,7 +112,7 @@ public function transactionAmountProvider() ]; } - private function createResponse(array $overrides = []) + private function createResponse(array $overrides = []): CreateResponse { $defaults = [ 'entityid' => '79767882', diff --git a/tests/unit/Orders/BusinessEmails/Responses/DeletedEmailAccountResponseTest.php b/tests/unit/Orders/BusinessEmails/Responses/DeletedEmailAccountResponseTest.php index e362e85..8e8d8d9 100644 --- a/tests/unit/Orders/BusinessEmails/Responses/DeletedEmailAccountResponseTest.php +++ b/tests/unit/Orders/BusinessEmails/Responses/DeletedEmailAccountResponseTest.php @@ -14,7 +14,7 @@ class DeletedEmailAccountResponseTest extends TestCase */ private $response; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -30,7 +30,7 @@ protected function setUp() ]); } - public function testItCanGetAction() + public function testItCanGetAction(): void { $this->assertInstanceOf(Action::class, $this->response->action()); $this->assertEquals(471836050, $this->response->action()->id()); @@ -49,17 +49,17 @@ public function testItCanGetAction() ); } - public function testItCanGetEntityId() + public function testItCanGetEntityId(): void { $this->assertEquals(80239999, $this->response->entityId()); } - public function testItCanGetDomain() + public function testItCanGetDomain(): void { $this->assertEquals('test-domain-3.co.uk.onlyfordemo.com', $this->response->domain()); } - public function testItCanGetStatus() + public function testItCanGetStatus(): void { $this->assertInstanceOf(Status::class, $this->response->status()); $this->assertEquals('success', (string) $this->response->status()); diff --git a/tests/unit/Orders/BusinessEmails/Responses/GetResponseTest.php b/tests/unit/Orders/BusinessEmails/Responses/GetResponseTest.php index 7a96cfc..a6a96e9 100644 --- a/tests/unit/Orders/BusinessEmails/Responses/GetResponseTest.php +++ b/tests/unit/Orders/BusinessEmails/Responses/GetResponseTest.php @@ -14,222 +14,222 @@ class GetResponseTest extends TestCase */ private $response; - public function testOrderId() + public function testOrderId(): void { $this->response = new GetResponse(['orderid' => 123]); - $this->assertInternalType('int', $this->response->orderId()); + $this->assertIsInt($this->response->orderId()); $this->assertEquals(123, $this->response->orderId()); } - public function testOrderDescription() + public function testOrderDescription(): void { $this->response = new GetResponse(['description' => 'name.onlyfordemo.com']); - $this->assertInternalType('string', $this->response->orderDescription()); + $this->assertIsString($this->response->orderDescription()); $this->assertEquals('name.onlyfordemo.com', $this->response->orderDescription()); } - public function testOrderCreationDate() + public function testOrderCreationDate(): void { $this->response = new GetResponse(['creationtime' => '1510142454']); $this->assertInstanceOf(Carbon::class, $this->response->orderCreationDate()); } - public function testOrderSuspendedAtExpiry() + public function testOrderSuspendedAtExpiry(): void { $this->response = new GetResponse(['isOrderSuspendedUponExpiry' => true]); - $this->assertInternalType('bool', $this->response->orderSuspendedAtExpiry()); + $this->assertIsBool($this->response->orderSuspendedAtExpiry()); $this->assertTrue($this->response->orderSuspendedAtExpiry()); } - public function testOrderSuspendedByParent() + public function testOrderSuspendedByParent(): void { $this->response = new GetResponse(['orderSuspendedByParent' => true]); - $this->assertInternalType('bool', $this->response->orderSuspendedByParent()); + $this->assertIsBool($this->response->orderSuspendedByParent()); $this->assertTrue($this->response->orderSuspendedByParent()); } - public function testOrderDeletionAllowed() + public function testOrderDeletionAllowed(): void { $this->response = new GetResponse(['allowdeletion' => true]); - $this->assertInternalType('bool', $this->response->orderDeletionAllowed()); + $this->assertIsBool($this->response->orderDeletionAllowed()); $this->assertTrue($this->response->orderDeletionAllowed()); } - public function testCurrentOrderStatus() + public function testCurrentOrderStatus(): void { $this->response = new GetResponse(['currentstatus' => 'Active']); $this->assertInstanceOf(OrderStatus::class, $this->response->currentOrderStatus()); } - public function testDomain() + public function testDomain(): void { $this->response = new GetResponse(['domainname' => 'name.onlyfordemo.com']); - $this->assertInternalType('string', $this->response->domain()); + $this->assertIsString($this->response->domain()); $this->assertEquals('name.onlyfordemo.com', $this->response->domain()); } - public function testExpiry() + public function testExpiry(): void { $this->response = new GetResponse(['endtime' => '1512734454']); $this->assertInstanceOf(Carbon::class, $this->response->expiry()); } - public function testIsImmediateReseller() + public function testIsImmediateReseller(): void { $this->response = new GetResponse(['isImmediateReseller' => true]); - $this->assertInternalType('bool', $this->response->isImmediateReseller()); + $this->assertIsBool($this->response->isImmediateReseller()); $this->assertTrue($this->response->isImmediateReseller()); } - public function testResellerParentId() + public function testResellerParentId(): void { $this->response = new GetResponse(['parentkey' => '999999999_999999998_715226']); - $this->assertInternalType('string', $this->response->resellerParentId()); + $this->assertIsString($this->response->resellerParentId()); $this->assertEquals('999999999_999999998_715226', $this->response->resellerParentId()); } - public function testCustomerId() + public function testCustomerId(): void { $this->response = new GetResponse(['customerid' => '17824872']); - $this->assertInternalType('int', $this->response->customerId()); + $this->assertIsInt($this->response->customerId()); $this->assertEquals(17824872, $this->response->customerId()); } - public function testNumberOfEmailAccounts() + public function testNumberOfEmailAccounts(): void { $this->response = new GetResponse(['emailaccounts' => 5]); - $this->assertInternalType('int', $this->response->numberOfEmailAccounts()); + $this->assertIsInt($this->response->numberOfEmailAccounts()); $this->assertEquals(5, $this->response->numberOfEmailAccounts()); } - public function testProductId() + public function testProductId(): void { $this->response = new GetResponse(['productkey' => 'eeliteus']); - $this->assertInternalType('string', $this->response->productId()); + $this->assertIsString($this->response->productId()); $this->assertEquals('eeliteus', $this->response->productId()); } - public function testProductCategory() + public function testProductCategory(): void { $this->response = new GetResponse(['productcategory' => 'hosting']); - $this->assertInternalType('string', $this->response->productCategory()); + $this->assertIsString($this->response->productCategory()); $this->assertEquals('hosting', $this->response->productCategory()); } - public function testEntityId() + public function testEntityId(): void { $this->response = new GetResponse(['entityid' => 123]); - $this->assertInternalType('int', $this->response->entityId()); + $this->assertIsInt($this->response->entityId()); $this->assertEquals(123, $this->response->entityId()); } - public function testEaqId() + public function testEaqId(): void { $this->response = new GetResponse(['eaqid' => 0]); - $this->assertInternalType('int', $this->response->eaqId()); + $this->assertIsInt($this->response->eaqId()); $this->assertEquals(0, $this->response->eaqId()); } - public function testPaused() + public function testPaused(): void { $this->response = new GetResponse(['paused' => false]); - $this->assertInternalType('bool', $this->response->paused()); + $this->assertIsBool($this->response->paused()); $this->assertFalse($this->response->paused()); } - public function testCustomerCost() + public function testCustomerCost(): void { $this->response = new GetResponse(['customercost' => '0.0']); - $this->assertInternalType('float', $this->response->customerCost()); + $this->assertIsFloat($this->response->customerCost()); $this->assertEquals('0.00', $this->response->customerCost()); } - public function testOrderStatus() + public function testOrderStatus(): void { $this->response = new GetResponse(['orderstatus' => []]); - $this->assertInternalType('array', $this->response->orderStatus()); + $this->assertIsArray($this->response->orderStatus()); } - public function testIsRecurring() + public function testIsRecurring(): void { $this->response = new GetResponse(['recurring' => false]); - $this->assertInternalType('bool', $this->response->isRecurring()); + $this->assertIsBool($this->response->isRecurring()); $this->assertFalse($this->response->isRecurring()); } - public function testEntityTypeId() + public function testEntityTypeId(): void { $this->response = new GetResponse(['entitytypeid' => 283]); - $this->assertInternalType('int', $this->response->entityTypeId()); + $this->assertIsInt($this->response->entityTypeId()); $this->assertEquals(283, $this->response->entityTypeId()); } - public function testDeletionRequest() + public function testDeletionRequest(): void { $this->response = new GetResponse(['isDeletionRequest' => false]); - $this->assertInternalType('bool', $this->response->deletionRequest()); + $this->assertIsBool($this->response->deletionRequest()); $this->assertFalse($this->response->deletionRequest()); } - public function testResellerCost() + public function testResellerCost(): void { $this->response = new GetResponse(['resellercost' => 0]); - $this->assertInternalType('float', $this->response->resellerCost()); + $this->assertIsFloat($this->response->resellerCost()); $this->assertEquals('0.00', $this->response->resellerCost()); } - public function testJumpConditions() + public function testJumpConditions(): void { $this->response = new GetResponse(['jumpConditions' => []]); - $this->assertInternalType('array', $this->response->jumpConditions()); + $this->assertIsArray($this->response->jumpConditions()); } - public function testCurrentOrderPrice() + public function testCurrentOrderPrice(): void { $this->response = new GetResponse(['currentOrderPrice' => '0.0']); - $this->assertInternalType('float', $this->response->currentOrderPrice()); + $this->assertIsFloat($this->response->currentOrderPrice()); $this->assertEquals('0.00', $this->response->currentOrderPrice()); } - public function testActionCompleted() + public function testActionCompleted(): void { $this->response = new GetResponse(['actioncompleted' => '0']); - $this->assertInternalType('string', $this->response->actionCompleted()); + $this->assertIsString($this->response->actionCompleted()); $this->assertEquals('0', $this->response->actionCompleted()); } - public function testMoneyBackPeriod() + public function testMoneyBackPeriod(): void { $this->response = new GetResponse(['moneybackperiod' => 30]); - $this->assertInternalType('int', $this->response->moneyBackPeriod()); + $this->assertIsInt($this->response->moneyBackPeriod()); $this->assertEquals(30, $this->response->moneyBackPeriod()); } } diff --git a/tests/unit/Orders/BusinessEmails/Responses/RenewalResponseTest.php b/tests/unit/Orders/BusinessEmails/Responses/RenewalResponseTest.php index 7f3f5e7..20315c0 100644 --- a/tests/unit/Orders/BusinessEmails/Responses/RenewalResponseTest.php +++ b/tests/unit/Orders/BusinessEmails/Responses/RenewalResponseTest.php @@ -14,7 +14,7 @@ class RenewalResponseTest extends TestCase */ private $response; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -34,22 +34,22 @@ protected function setUp() ]); } - public function testItCanGetDescription() + public function testItCanGetDescription(): void { $this->assertEquals('Test description', $this->response->description()); } - public function testItCanGetEntityId() + public function testItCanGetEntityId(): void { $this->assertEquals(123, $this->response->entityId()); } - public function testItCanGetActionType() + public function testItCanGetActionType(): void { $this->assertEquals('Renew', $this->response->actiontype); } - public function testItCanGetActionTypeDescription() + public function testItCanGetActionTypeDescription(): void { $this->assertEquals( 'Renewal of Business Email 1 for example.com for 1 month', @@ -57,17 +57,17 @@ public function testItCanGetActionTypeDescription() ); } - public function testItCanGetActionId() + public function testItCanGetActionId(): void { $this->assertEquals(461863406, $this->response->actionId()); } - public function testItCanGetActionStatus() + public function testItCanGetActionStatus(): void { $this->assertEquals('InvoicePaid', $this->response->actionStatus()); } - public function testItCanGetActionStatusDescription() + public function testItCanGetActionStatusDescription(): void { $this->assertEquals( 'Your Order will be processed by our automatic provisioning system in the next 5-10 minutes.', @@ -75,34 +75,34 @@ public function testItCanGetActionStatusDescription() ); } - public function testItCanGetInvoiceId() + public function testItCanGetInvoiceId(): void { $this->assertEquals(123, $this->response->invoiceId()); } - public function testItCanGetSellingCurrencySymbol() + public function testItCanGetSellingCurrencySymbol(): void { $this->assertEquals('GBP', $this->response->sellingCurrencySymbol()); } - public function testItCanGetSellingCurrency() + public function testItCanGetSellingCurrency(): void { $this->assertInstanceOf(Currency::class, $this->response->sellingCurrency()); } - public function testItCanGetSellingAmount() + public function testItCanGetSellingAmount(): void { $this->assertInstanceOf(Money::class, $this->response->sellingAmount()); $this->assertEquals(1899, $this->response->sellingAmount()->getAmount()); } - public function testItCanGetUnutilisedSellingAmount() + public function testItCanGetUnutilisedSellingAmount(): void { $this->assertInstanceOf(Money::class, $this->response->unutilisedSellingAmount()); $this->assertEquals(101, $this->response->unutilisedSellingAmount()->getAmount()); } - public function testItCanGetCustomerId() + public function testItCanGetCustomerId(): void { $this->assertEquals(123, $this->response->customerId()); } diff --git a/tests/unit/Orders/ContactTest.php b/tests/unit/Orders/ContactTest.php index 3a59544..c2d7cc0 100644 --- a/tests/unit/Orders/ContactTest.php +++ b/tests/unit/Orders/ContactTest.php @@ -15,7 +15,7 @@ class ContactTest extends TestCase */ private $contact; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->contact = new Contact( @@ -43,41 +43,41 @@ protected function setUp() ); } - public function testId() + public function testId(): void { - $this->assertInternalType('integer', $this->contact->id()); + $this->assertIsInt($this->contact->id()); $this->assertEquals(123, $this->contact->id()); } - public function testCustomerId() + public function testCustomerId(): void { - $this->assertInternalType('integer', $this->contact->customerId()); + $this->assertIsInt($this->contact->customerId()); $this->assertEquals(456, $this->contact->customerId()); } - public function testParentId() + public function testParentId(): void { - $this->assertInternalType('string', $this->contact->parentId()); + $this->assertIsString($this->contact->parentId()); $this->assertEquals('999999999_999999998_715226', $this->contact->parentId()); } - public function testName() + public function testName(): void { - $this->assertInternalType('string', $this->contact->name()); + $this->assertIsString($this->contact->name()); $this->assertEquals('Testy McTest', $this->contact->name()); } - public function testEmailAddress() + public function testEmailAddress(): void { $this->assertInstanceOf(EmailAddress::class, $this->contact->email()); } - public function testTelephoneNumber() + public function testTelephoneNumber(): void { $this->assertInstanceOf(TelephoneNumber::class, $this->contact->telephoneNumber()); } - public function testAddress() + public function testAddress(): void { $this->assertInstanceOf(Address::class, $this->contact->address()); } diff --git a/tests/unit/Orders/Domains/DelegationSignerTest.php b/tests/unit/Orders/Domains/DelegationSignerTest.php index d168d7e..3092c46 100644 --- a/tests/unit/Orders/Domains/DelegationSignerTest.php +++ b/tests/unit/Orders/Domains/DelegationSignerTest.php @@ -12,7 +12,7 @@ class DelegationSignerTest extends TestCase */ private $delegationSigner; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->delegationSigner = new DelegationSigner( @@ -23,22 +23,22 @@ protected function setUp() ); } - public function testKeyTag() + public function testKeyTag(): void { $this->assertEquals('some-key-tag', $this->delegationSigner->keyTag()); } - public function testAlgorithm() + public function testAlgorithm(): void { $this->assertEquals('RSA-SHA256', $this->delegationSigner->algorithm()); } - public function testDigest() + public function testDigest(): void { $this->assertEquals('some-digest', $this->delegationSigner->digest()); } - public function testDigestType() + public function testDigestType(): void { $this->assertEquals('SHA-256', $this->delegationSigner->digestType()); } diff --git a/tests/unit/Orders/Domains/DomainOrderDetailTypeTest.php b/tests/unit/Orders/Domains/DomainOrderDetailTypeTest.php index 9062f08..e5c7d6f 100644 --- a/tests/unit/Orders/Domains/DomainOrderDetailTypeTest.php +++ b/tests/unit/Orders/Domains/DomainOrderDetailTypeTest.php @@ -7,7 +7,7 @@ class DomainOrderDetailTypeTest extends TestCase { - public function testValidDetailTypes() + public function testValidDetailTypes(): void { $this->assertInstanceOf( DomainOrderDetailType::class, diff --git a/tests/unit/Orders/Domains/DomainOrderTest.php b/tests/unit/Orders/Domains/DomainOrderTest.php index 4cfc8ff..3cf6f0b 100644 --- a/tests/unit/Orders/Domains/DomainOrderTest.php +++ b/tests/unit/Orders/Domains/DomainOrderTest.php @@ -22,7 +22,7 @@ class DomainOrderTest extends TestCase { - public function testResponseFromDomainOrderGet() + public function testResponseFromDomainOrderGet(): void { $mock = new MockHandler([ new Response( @@ -45,7 +45,7 @@ public function testResponseFromDomainOrderGet() ); } - public function testResponseFromDomainOrderGetByDomain() + public function testResponseFromDomainOrderGetByDomain(): void { $mock = new MockHandler([ new Response( @@ -68,7 +68,7 @@ public function testResponseFromDomainOrderGetByDomain() ); } - public function testResponseFromDomainOrderRenew() + public function testResponseFromDomainOrderRenew(): void { $mock = new MockHandler([ new Response( diff --git a/tests/unit/Orders/Domains/NamedServersTest.php b/tests/unit/Orders/Domains/NamedServersTest.php index 7727699..cdba44d 100644 --- a/tests/unit/Orders/Domains/NamedServersTest.php +++ b/tests/unit/Orders/Domains/NamedServersTest.php @@ -12,7 +12,7 @@ class NamedServersTest extends TestCase */ private $namedServers; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->namedServers = new NamedServers( @@ -23,22 +23,22 @@ protected function setUp() ); } - public function testNumberOfNamedServers() + public function testNumberOfNamedServers(): void { $this->assertEquals(2, $this->namedServers->numberOfServers()); } - public function testNamedServer1() + public function testNamedServer1(): void { $this->assertEquals('ns1.test.example.com', $this->namedServers->namedServer1()); } - public function testNamedServer2() + public function testNamedServer2(): void { $this->assertEquals('ns2.testing.example.com', $this->namedServers->namedServer2()); } - public function testChildNamedServer() + public function testChildNamedServer(): void { $this->assertEquals('ns3.child-named-server.example.com', $this->namedServers->childNamedServer()); } diff --git a/tests/unit/Orders/Domains/PrivacyProtectionTest.php b/tests/unit/Orders/Domains/PrivacyProtectionTest.php index b1d5382..b429714 100644 --- a/tests/unit/Orders/Domains/PrivacyProtectionTest.php +++ b/tests/unit/Orders/Domains/PrivacyProtectionTest.php @@ -13,7 +13,7 @@ class PrivacyProtectionTest extends TestCase */ private $privacyProtection; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->privacyProtection = new PrivacyProtection( @@ -24,7 +24,7 @@ protected function setUp() ); } - public function testExpiry() + public function testExpiry(): void { $this->assertInstanceOf(Carbon::class, $this->privacyProtection->expiry()); $this->assertEquals( @@ -33,17 +33,17 @@ public function testExpiry() ); } - public function testRegistrantContact() + public function testRegistrantContact(): void { $this->assertEquals('registrant', $this->privacyProtection->registrantContact()); } - public function testAdminContact() + public function testAdminContact(): void { $this->assertEquals('admin', $this->privacyProtection->adminContact()); } - public function testBillingContact() + public function testBillingContact(): void { $this->assertEquals('billing', $this->privacyProtection->billingContact()); } diff --git a/tests/unit/Orders/Domains/RegistrantContactVerificationTest.php b/tests/unit/Orders/Domains/RegistrantContactVerificationTest.php index 6d40370..4f3ee41 100644 --- a/tests/unit/Orders/Domains/RegistrantContactVerificationTest.php +++ b/tests/unit/Orders/Domains/RegistrantContactVerificationTest.php @@ -18,7 +18,7 @@ class RegistrantContactVerificationTest extends TestCase */ private $verified; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -33,13 +33,13 @@ protected function setUp() ); } - public function testVerificationStatus() + public function testVerificationStatus(): void { $this->assertEquals('Pending', $this->pendingVerification->status()); $this->assertEquals('Verified', $this->verified->status()); } - public function testVerificationProcessStartTimeWhenSet() + public function testVerificationProcessStartTimeWhenSet(): void { $this->assertInstanceOf( Carbon::class, @@ -52,7 +52,7 @@ public function testVerificationProcessStartTimeWhenSet() ); } - public function testVerificationProcessStartTimeWhenNotSet() + public function testVerificationProcessStartTimeWhenNotSet(): void { $this->assertNull( $this->verified->verificationProcessStartTime() diff --git a/tests/unit/Orders/Domains/RegistryStatusTest.php b/tests/unit/Orders/Domains/RegistryStatusTest.php index fe85ec5..b7c9139 100644 --- a/tests/unit/Orders/Domains/RegistryStatusTest.php +++ b/tests/unit/Orders/Domains/RegistryStatusTest.php @@ -7,31 +7,31 @@ class RegistryStatusTest extends TestCase { - public function testObjectToString() + public function testObjectToString(): void { $this->assertEquals('resellersuspend', (string) new RegistryStatus('resellersuspend')); $this->assertEquals('', (string) new RegistryStatus('')); } - public function testIsSuspended() + public function testIsSuspended(): void { $this->assertTrue((new RegistryStatus('resellersuspend'))->isSuspended()); $this->assertFalse((new RegistryStatus('not_suspended_state'))->isSuspended()); } - public function testIsLockedAtReseller() + public function testIsLockedAtReseller(): void { $this->assertTrue((new RegistryStatus('resellerlock'))->isLockedAtReseller()); $this->assertFalse((new RegistryStatus('not_locked_state'))->isLockedAtReseller()); } - public function testIsLockedAtTransfer() + public function testIsLockedAtTransfer(): void { $this->assertTrue((new RegistryStatus('transferlock'))->isLockedAtTransfer()); $this->assertFalse((new RegistryStatus('not_locked_state'))->isLockedAtTransfer()); } - public function testIsLocked() + public function testIsLocked(): void { $this->assertTrue((new RegistryStatus('resellerlock'))->isLocked()); $this->assertTrue((new RegistryStatus('transferlock'))->isLocked()); diff --git a/tests/unit/Orders/Domains/Requests/GetRequestTest.php b/tests/unit/Orders/Domains/Requests/GetRequestTest.php index ae02177..3ffe495 100644 --- a/tests/unit/Orders/Domains/Requests/GetRequestTest.php +++ b/tests/unit/Orders/Domains/Requests/GetRequestTest.php @@ -19,7 +19,7 @@ class GetRequestTest extends TestCase */ private $request; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -31,12 +31,12 @@ protected function setUp() ); } - public function testItCanGetOrderId() + public function testItCanGetOrderId(): void { $this->assertEquals(123, $this->request->orderId()); } - public function testItCanGetOrderDetailType() + public function testItCanGetOrderDetailType(): void { $this->assertInstanceOf(DomainOrderDetailType::class, $this->request->orderDetailType()); $this->assertEquals((string) $this->domainOrderDetailType, $this->request->orderDetailType()); diff --git a/tests/unit/Orders/Domains/Requests/GetbyDomainRequestTest.php b/tests/unit/Orders/Domains/Requests/GetbyDomainRequestTest.php index 248c719..153daf6 100644 --- a/tests/unit/Orders/Domains/Requests/GetbyDomainRequestTest.php +++ b/tests/unit/Orders/Domains/Requests/GetbyDomainRequestTest.php @@ -18,7 +18,7 @@ class GetbyDomainRequestTest extends TestCase */ private $request; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -30,12 +30,12 @@ protected function setUp() ); } - public function testItCanGetOrderId() + public function testItCanGetOrderId(): void { $this->assertEquals('some-domain.co.uk', $this->request->domain()); } - public function testItCanGetOrderDetailType() + public function testItCanGetOrderDetailType(): void { $this->assertInstanceOf(DomainOrderDetailType::class, $this->request->orderDetailType()); $this->assertEquals((string) $this->domainOrderDetailType, $this->request->orderDetailType()); diff --git a/tests/unit/Orders/Domains/Requests/RenewRequestTest.php b/tests/unit/Orders/Domains/Requests/RenewRequestTest.php index 22e2482..15349f4 100644 --- a/tests/unit/Orders/Domains/Requests/RenewRequestTest.php +++ b/tests/unit/Orders/Domains/Requests/RenewRequestTest.php @@ -27,7 +27,7 @@ class RenewRequestTest extends TestCase */ private $request; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -45,27 +45,27 @@ protected function setUp() ); } - public function testOrderId() + public function testOrderId(): void { - $this->assertInternalType('int', $this->request->orderId()); + $this->assertIsInt($this->request->orderId()); $this->assertEquals(123, $this->request->orderId()); } - public function testCurrentExpiryTimestamp() + public function testCurrentExpiryTimestamp(): void { - $this->assertInternalType('int', $this->request->currentExpiryTimestamp()); + $this->assertIsInt($this->request->currentExpiryTimestamp()); $this->assertEquals($this->currentExpiry->getTimestamp(), $this->request->currentExpiryTimestamp()); } - public function testInvoiceOption() + public function testInvoiceOption(): void { $this->assertInstanceOf(InvoiceOption::class, $this->request->invoiceOption()); $this->assertEquals((string) $this->invoiceOption, (string) $this->request->invoiceOption()); } - public function testYears() + public function testYears(): void { - $this->assertInternalType('int', $this->request->years()); + $this->assertIsInt($this->request->years()); $this->assertEquals(1, $this->request->years()); $this->request = new RenewRequest( @@ -77,13 +77,13 @@ public function testYears() $autoRenew = false ); - $this->assertInternalType('int', $this->request->years()); + $this->assertIsInt($this->request->years()); $this->assertEquals(0, $this->request->years()); } - public function testPurchasePrivacyProtection() + public function testPurchasePrivacyProtection(): void { - $this->assertInternalType('bool', $this->request->purchasePrivacyProtection()); + $this->assertIsBool($this->request->purchasePrivacyProtection()); $this->assertFalse($this->request->purchasePrivacyProtection()); $this->request = new RenewRequest( @@ -98,9 +98,9 @@ public function testPurchasePrivacyProtection() $this->assertTrue($this->request->purchasePrivacyProtection()); } - public function testAutoRenew() + public function testAutoRenew(): void { - $this->assertInternalType('bool', $this->request->autoRenew()); + $this->assertIsBool($this->request->autoRenew()); $this->assertFalse($this->request->autoRenew()); $this->request = new RenewRequest( diff --git a/tests/unit/Orders/Domains/Responses/GetResponseTest.php b/tests/unit/Orders/Domains/Responses/GetResponseTest.php index 69196bd..8518201 100644 --- a/tests/unit/Orders/Domains/Responses/GetResponseTest.php +++ b/tests/unit/Orders/Domains/Responses/GetResponseTest.php @@ -17,11 +17,11 @@ class GetResponseTest extends TestCase { - public function testEntityId() + public function testEntityId(): void { $response = new GetResponse(['entityid' => 123]); - $this->assertInternalType('int', $response->entityId()); + $this->assertIsInt($response->entityId()); $this->assertEquals(123, $response->entityId()); } @@ -29,57 +29,57 @@ public function testOrderId() { $response = new GetResponse(['orderid' => 123]); - $this->assertInternalType('int', $response->orderId()); + $this->assertIsInt($response->orderId()); $this->assertEquals(123, $response->orderId()); $response = new GetResponse(['orderid' => null]); - $this->assertInternalType('int', $response->orderId()); + $this->assertIsInt($response->orderId()); $this->assertEquals(0, $response->orderId()); $response = new GetResponse([]); - $this->assertInternalType('int', $response->orderId()); + $this->assertIsInt($response->orderId()); $this->assertEquals(0, $response->orderId()); } - public function testDescription() + public function testDescription(): void { $response = new GetResponse(['description' => 'domain description']); - $this->assertInternalType('string', $response->description()); + $this->assertIsString($response->description()); $this->assertEquals('domain description', $response->description()); $response = new GetResponse(['description' => null]); - $this->assertInternalType('string', $response->description()); + $this->assertIsString($response->description()); $this->assertEquals('', $response->description()); $response = new GetResponse([]); - $this->assertInternalType('string', $response->description()); + $this->assertIsString($response->description()); $this->assertEquals('', $response->description()); } - public function testDomain() + public function testDomain(): void { $response = new GetResponse(['domainname' => 'some-domain.co.uk']); - $this->assertInternalType('string', $response->domain()); + $this->assertIsString($response->domain()); $this->assertEquals('some-domain.co.uk', $response->domain()); $response = new GetResponse(['domainname' => null]); - $this->assertInternalType('string', $response->domain()); + $this->assertIsString($response->domain()); $this->assertEquals('', $response->domain()); $response = new GetResponse([]); - $this->assertInternalType('string', $response->domain()); + $this->assertIsString($response->domain()); $this->assertEquals('', $response->domain()); } - public function testCurrentOrderStatus() + public function testCurrentOrderStatus(): void { $response = new GetResponse(['currentstatus' => 'Active']); $this->assertInstanceOf(OrderStatus::class, $response->currentOrderStatus()); @@ -91,13 +91,13 @@ public function testCurrentOrderStatus() $this->assertInstanceOf(OrderStatus::class, $response->currentOrderStatus()); } - public function testRegistryStatus() + public function testRegistryStatus(): void { $response = new GetResponse(['orderstatus' => 'resellerlock']); $this->assertInstanceOf(RegistryStatus::class, $response->registryStatus()); } - public function testLockedOrHoldStatus() + public function testLockedOrHoldStatus(): void { $response = new GetResponse(['domainstatus' => ['sixtydaylock']]); $this->assertInstanceOf(LockedOrHoldStatus::class, $response->lockedOrHoldStatus()); @@ -106,243 +106,243 @@ public function testLockedOrHoldStatus() $this->assertInstanceOf(LockedOrHoldStatus::class, $response->lockedOrHoldStatus()); } - public function testProductCategory() + public function testProductCategory(): void { $response = new GetResponse(['productcategory' => 'domorder']); - $this->assertInternalType('string', $response->productCategory()); + $this->assertIsString($response->productCategory()); $this->assertEquals('domorder', $response->productCategory()); $response = new GetResponse(['productcategory' => null]); - $this->assertInternalType('string', $response->productCategory()); + $this->assertIsString($response->productCategory()); $this->assertEquals('', $response->productCategory()); $response = new GetResponse([]); - $this->assertInternalType('string', $response->productCategory()); + $this->assertIsString($response->productCategory()); $this->assertEquals('', $response->productCategory()); } - public function testProductId() + public function testProductId(): void { $response = new GetResponse(['productkey' => 'dominfo']); - $this->assertInternalType('string', $response->productId()); + $this->assertIsString($response->productId()); $this->assertEquals('dominfo', $response->productId()); $response = new GetResponse(['productcategory' => null]); - $this->assertInternalType('string', $response->productId()); + $this->assertIsString($response->productId()); $this->assertEquals('', $response->productId()); $response = new GetResponse([]); - $this->assertInternalType('string', $response->productId()); + $this->assertIsString($response->productId()); $this->assertEquals('', $response->productId()); } - public function testRegistryDate() + public function testRegistryDate(): void { $response = new GetResponse(['creationtime' => '1547570574']); $this->assertInstanceOf(Carbon::class, $response->registryDate()); $this->assertEquals(Carbon::createFromTimestamp(1547570574), $response->registryDate()); } - public function testRegistryExpiryDate() + public function testRegistryExpiryDate(): void { $response = new GetResponse(['endtime' => '1547570898']); $this->assertInstanceOf(Carbon::class, $response->registryExpiryDate()); $this->assertEquals(Carbon::createFromTimestamp(1547570898), $response->registryExpiryDate()); } - public function testCustomerId() + public function testCustomerId(): void { $response = new GetResponse(['customerid' => '17824872']); - $this->assertInternalType('int', $response->customerId()); + $this->assertIsInt($response->customerId()); $this->assertEquals(17824872, $response->customerId()); $response = new GetResponse(['customerid' => null]); - $this->assertInternalType('int', $response->customerId()); + $this->assertIsInt($response->customerId()); $this->assertEquals(0, $response->customerId()); $response = new GetResponse([]); - $this->assertInternalType('int', $response->customerId()); + $this->assertIsInt($response->customerId()); $this->assertEquals(0, $response->customerId()); } - public function testIsImmediateReseller() + public function testIsImmediateReseller(): void { $response = new GetResponse(['isImmediateReseller' => true]); - $this->assertInternalType('bool', $response->isImmediateReseller()); + $this->assertIsBool($response->isImmediateReseller()); $this->assertTrue($response->isImmediateReseller()); $response = new GetResponse(['isImmediateReseller' => false]); - $this->assertInternalType('bool', $response->isImmediateReseller()); + $this->assertIsBool($response->isImmediateReseller()); $this->assertFalse($response->isImmediateReseller()); $response = new GetResponse(['isImmediateReseller' => null]); - $this->assertInternalType('bool', $response->isImmediateReseller()); + $this->assertIsBool($response->isImmediateReseller()); $this->assertFalse($response->isImmediateReseller()); $response = new GetResponse([]); - $this->assertInternalType('bool', $response->isImmediateReseller()); + $this->assertIsBool($response->isImmediateReseller()); $this->assertFalse($response->isImmediateReseller()); } - public function testResellerParentId() + public function testResellerParentId(): void { $response = new GetResponse(['parentkey' => '999999999_999999998_000000']); - $this->assertInternalType('string', $response->resellerParentId()); + $this->assertIsString($response->resellerParentId()); $this->assertEquals('999999999_999999998_000000', $response->resellerParentId()); $response = new GetResponse(['parentkey' => null]); - $this->assertInternalType('string', $response->resellerParentId()); + $this->assertIsString($response->resellerParentId()); $this->assertEquals('', $response->resellerParentId()); $response = new GetResponse([]); - $this->assertInternalType('string', $response->resellerParentId()); + $this->assertIsString($response->resellerParentId()); $this->assertEquals('', $response->resellerParentId()); } - public function testIsPrivacyProtectionAllowed() + public function testIsPrivacyProtectionAllowed(): void { $response = new GetResponse(['privacyprotectedallowed' => true]); - $this->assertInternalType('bool', $response->isPrivacyProtectionAllowed()); + $this->assertIsBool($response->isPrivacyProtectionAllowed()); $this->assertTrue($response->isPrivacyProtectionAllowed()); $response = new GetResponse(['privacyprotectedallowed' => false]); - $this->assertInternalType('bool', $response->isPrivacyProtectionAllowed()); + $this->assertIsBool($response->isPrivacyProtectionAllowed()); $this->assertFalse($response->isPrivacyProtectionAllowed()); $response = new GetResponse(['privacyprotectedallowed' => null]); - $this->assertInternalType('bool', $response->isPrivacyProtectionAllowed()); + $this->assertIsBool($response->isPrivacyProtectionAllowed()); $this->assertFalse($response->isPrivacyProtectionAllowed()); $response = new GetResponse([]); - $this->assertInternalType('bool', $response->isPrivacyProtectionAllowed()); + $this->assertIsBool($response->isPrivacyProtectionAllowed()); $this->assertFalse($response->isPrivacyProtectionAllowed()); } - public function testIsPrivacyProtected() + public function testIsPrivacyProtected(): void { $response = new GetResponse(['isprivacyprotected' => true]); - $this->assertInternalType('bool', $response->isPrivacyProtected()); + $this->assertIsBool($response->isPrivacyProtected()); $this->assertTrue($response->isPrivacyProtected()); $response = new GetResponse(['isprivacyprotected' => false]); - $this->assertInternalType('bool', $response->isPrivacyProtected()); + $this->assertIsBool($response->isPrivacyProtected()); $this->assertFalse($response->isPrivacyProtected()); $response = new GetResponse(['isprivacyprotected' => null]); - $this->assertInternalType('bool', $response->isPrivacyProtected()); + $this->assertIsBool($response->isPrivacyProtected()); $this->assertFalse($response->isPrivacyProtected()); $response = new GetResponse([]); - $this->assertInternalType('bool', $response->isPrivacyProtected()); + $this->assertIsBool($response->isPrivacyProtected()); $this->assertFalse($response->isPrivacyProtected()); } - public function testIsDeletionAllowed() + public function testIsDeletionAllowed(): void { $response = new GetResponse(['allowdeletion' => true]); - $this->assertInternalType('bool', $response->isDeletionAllowed()); + $this->assertIsBool($response->isDeletionAllowed()); $this->assertTrue($response->isDeletionAllowed()); $response = new GetResponse(['allowdeletion' => false]); - $this->assertInternalType('bool', $response->isDeletionAllowed()); + $this->assertIsBool($response->isDeletionAllowed()); $this->assertFalse($response->isDeletionAllowed()); $response = new GetResponse(['allowdeletion' => null]); - $this->assertInternalType('bool', $response->isDeletionAllowed()); + $this->assertIsBool($response->isDeletionAllowed()); $this->assertFalse($response->isDeletionAllowed()); $response = new GetResponse([]); - $this->assertInternalType('bool', $response->isDeletionAllowed()); + $this->assertIsBool($response->isDeletionAllowed()); $this->assertFalse($response->isDeletionAllowed()); } - public function testIsSuspendedUponExpiry() + public function testIsSuspendedUponExpiry(): void { $response = new GetResponse(['isOrderSuspendedUponExpiry' => true]); - $this->assertInternalType('bool', $response->isSuspendedUponExpiry()); + $this->assertIsBool($response->isSuspendedUponExpiry()); $this->assertTrue($response->isSuspendedUponExpiry()); $response = new GetResponse(['isOrderSuspendedUponExpiry' => false]); - $this->assertInternalType('bool', $response->isSuspendedUponExpiry()); + $this->assertIsBool($response->isSuspendedUponExpiry()); $this->assertFalse($response->isSuspendedUponExpiry()); $response = new GetResponse(['isOrderSuspendedUponExpiry' => null]); - $this->assertInternalType('bool', $response->isSuspendedUponExpiry()); + $this->assertIsBool($response->isSuspendedUponExpiry()); $this->assertFalse($response->isSuspendedUponExpiry()); $response = new GetResponse([]); - $this->assertInternalType('bool', $response->isSuspendedUponExpiry()); + $this->assertIsBool($response->isSuspendedUponExpiry()); $this->assertFalse($response->isSuspendedUponExpiry()); } - public function testIsSuspendedByParent() + public function testIsSuspendedByParent(): void { $response = new GetResponse(['orderSuspendedByParent' => true]); - $this->assertInternalType('bool', $response->isSuspendedByParent()); + $this->assertIsBool($response->isSuspendedByParent()); $this->assertTrue($response->isSuspendedByParent()); $response = new GetResponse(['orderSuspendedByParent' => false]); - $this->assertInternalType('bool', $response->isSuspendedByParent()); + $this->assertIsBool($response->isSuspendedByParent()); $this->assertFalse($response->isSuspendedByParent()); $response = new GetResponse(['orderSuspendedByParent' => null]); - $this->assertInternalType('bool', $response->isSuspendedByParent()); + $this->assertIsBool($response->isSuspendedByParent()); $this->assertFalse($response->isSuspendedByParent()); $response = new GetResponse([]); - $this->assertInternalType('bool', $response->isSuspendedByParent()); + $this->assertIsBool($response->isSuspendedByParent()); $this->assertFalse($response->isSuspendedByParent()); } - public function testDomainSecret() + public function testDomainSecret(): void { $response = new GetResponse(['domsecret' => 'abc123']); - $this->assertInternalType('string', $response->domainSecret()); + $this->assertIsString($response->domainSecret()); $this->assertEquals('abc123', $response->domainSecret()); $response = new GetResponse(['domsecret' => null]); - $this->assertInternalType('string', $response->domainSecret()); + $this->assertIsString($response->domainSecret()); $this->assertEquals('', $response->domain()); $response = new GetResponse([]); - $this->assertInternalType('string', $response->domainSecret()); + $this->assertIsString($response->domainSecret()); $this->assertEquals('', $response->domainSecret()); } - public function testNamedServers() + public function testNamedServers(): void { $response = new GetResponse([ 'noOfNameServers' => 2, @@ -360,7 +360,7 @@ public function testNamedServers() $this->assertEquals('ns3.test.example.com', $response->namedServers()->childNamedServer()); } - public function testRegistrantContact() + public function testRegistrantContact(): void { $response = new GetResponse([ 'registrantcontact' => [ @@ -405,7 +405,7 @@ public function testRegistrantContact() $this->assertEquals('EX3 5MP', $response->registrantContact()->address()->postCode()); } - public function testAdminContact() + public function testAdminContact(): void { $response = new GetResponse([ 'admincontact' => [ @@ -450,7 +450,7 @@ public function testAdminContact() $this->assertEquals('EX3 5MP', $response->adminContact()->address()->postCode()); } - public function testTechnicalContact() + public function testTechnicalContact(): void { $response = new GetResponse([ 'techcontact' => [ @@ -495,7 +495,7 @@ public function testTechnicalContact() $this->assertEquals('EX3 5MP', $response->technicalContact()->address()->postCode()); } - public function testBillingContact() + public function testBillingContact(): void { $response = new GetResponse([ 'billingcontact' => [ @@ -540,7 +540,7 @@ public function testBillingContact() $this->assertEquals('EX3 5MP', $response->billingContact()->address()->postCode()); } - public function testGdprProtection() + public function testGdprProtection(): void { $response = new GetResponse([ 'gdpr' => [ @@ -554,7 +554,7 @@ public function testGdprProtection() $this->assertFalse($response->gdprProtection()->eligible()); } - public function testRegistrantContactVerification() + public function testRegistrantContactVerification(): void { $response = new GetResponse([ 'raaVerificationStatus' => 'Pending', @@ -569,7 +569,7 @@ public function testRegistrantContactVerification() ); } - public function testPrivacyProtection() + public function testPrivacyProtection(): void { $response = new GetResponse([ 'privacyprotectendtime' => '1547565748', @@ -585,7 +585,7 @@ public function testPrivacyProtection() $this->assertEquals('billing', $response->privacyProtection()->billingContact()); } - public function testDelegationSigner() + public function testDelegationSigner(): void { $response = new GetResponse([ 'dnssec' => [ @@ -603,13 +603,13 @@ public function testDelegationSigner() $this->assertEquals('SHA-256', $response->delegationSigner()->digestType()); } - public function testRecurring() + public function testRecurring(): void { $response = new GetResponse([ 'recurring' => true, ]); - $this->assertInternalType('bool', $response->recurring()); + $this->assertIsBool($response->recurring()); $this->assertTrue($response->recurring()); $response = new GetResponse([ @@ -621,84 +621,84 @@ public function testRecurring() $this->assertFalse($response->recurring()); } - public function testCustomerCost() + public function testCustomerCost(): void { $response = new GetResponse(['customercost' => '0.0']); - $this->assertInternalType('float', $response->customerCost()); + $this->assertIsFloat($response->customerCost()); $this->assertEquals('0.00', $response->customerCost()); } - public function testMoneyBackPeriod() + public function testMoneyBackPeriod(): void { $response = new GetResponse(['moneybackperiod' => 30]); - $this->assertInternalType('int', $response->moneyBackPeriod()); + $this->assertIsInt($response->moneyBackPeriod()); $this->assertEquals(30, $response->moneyBackPeriod()); } - public function testResellerCost() + public function testResellerCost(): void { $response = new GetResponse(['resellercost' => '0.0']); - $this->assertInternalType('float', $response->resellerCost()); + $this->assertIsFloat($response->resellerCost()); $this->assertEquals('0.00', $response->resellerCost()); } - public function testJumpConditions() + public function testJumpConditions(): void { $response = new GetResponse(['jumpConditions' => []]); - $this->assertInternalType('array', $response->jumpConditions()); + $this->assertIsArray($response->jumpConditions()); } - public function testPaused() + public function testPaused(): void { $response = new GetResponse(['paused' => true]); - $this->assertInternalType('bool', $response->paused()); + $this->assertIsBool($response->paused()); $this->assertTrue($response->paused()); $response = new GetResponse(['paused' => false]); - $this->assertInternalType('bool', $response->paused()); + $this->assertIsBool($response->paused()); $this->assertFalse($response->paused()); } - public function testEaqId() + public function testEaqId(): void { $response = new GetResponse(['eaqid' => 0]); - $this->assertInternalType('int', $response->eaqId()); + $this->assertIsInt($response->eaqId()); $this->assertEquals(0, $response->eaqId()); } - public function testEntityTypeId() + public function testEntityTypeId(): void { $response = new GetResponse(['entitytypeid' => 283]); - $this->assertInternalType('int', $response->entityTypeId()); + $this->assertIsInt($response->entityTypeId()); $this->assertEquals(283, $response->entityTypeId()); } - public function testActionCompleted() + public function testActionCompleted(): void { $response = new GetResponse(['actioncompleted' => '0']); - $this->assertInternalType('string', $response->actionCompleted()); + $this->assertIsString($response->actionCompleted()); $this->assertEquals('0', $response->actionCompleted()); } - public function testAutoRenewAttemptDuration() + public function testAutoRenewAttemptDuration(): void { $response = new GetResponse(['actioncompleted' => '0']); - $this->assertInternalType('integer', $response->autoRenewAttemptDuration()); + $this->assertIsInt($response->autoRenewAttemptDuration()); $this->assertEquals('0', $response->autoRenewAttemptDuration()); } - public function testAutoRenewTermType() + public function testAutoRenewTermType(): void { $response = new GetResponse(['autoRenewTermType' => 'LONG_TERM']); - $this->assertInternalType('string', $response->autoRenewTermType()); + $this->assertIsString($response->autoRenewTermType()); $this->assertEquals('LONG_TERM', $response->autoRenewTermType()); } } diff --git a/tests/unit/Orders/Domains/Responses/PrivacyProtectionOrderResponseTest.php b/tests/unit/Orders/Domains/Responses/PrivacyProtectionOrderResponseTest.php index 8e89967..dcfa404 100644 --- a/tests/unit/Orders/Domains/Responses/PrivacyProtectionOrderResponseTest.php +++ b/tests/unit/Orders/Domains/Responses/PrivacyProtectionOrderResponseTest.php @@ -17,7 +17,7 @@ class PrivacyProtectionOrderResponseTest extends TestCase */ private $response; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -38,7 +38,7 @@ protected function setUp() ]); } - public function testFeatureNotAvailableExceptionThrown() + public function testFeatureNotAvailableExceptionThrown(): void { $this->expectException(FeatureNotAvailableException::class); @@ -49,17 +49,17 @@ public function testFeatureNotAvailableExceptionThrown() ]); } - public function testItCanOrderId() + public function testItCanOrderId(): void { $this->assertEquals(85575828, $this->response->orderId()); } - public function testItCanGetDescription() + public function testItCanGetDescription(): void { $this->assertEquals('wibble-wibble.net', $this->response->description()); } - public function testItCanGetAction() + public function testItCanGetAction(): void { $action = $this->response->action(); $this->assertInstanceOf(Action::class, $action); @@ -73,34 +73,34 @@ public function testItCanGetAction() $this->assertEquals('Operation completed successfully', $action->statusDescription()); } - public function testItCanGetInvoiceId() + public function testItCanGetInvoiceId(): void { $this->assertEquals(88768089, $this->response->invoiceId()); } - public function testItCanGetSellingCurrencySymbol() + public function testItCanGetSellingCurrencySymbol(): void { $this->assertEquals('GBP', $this->response->sellingCurrencySymbol()); } - public function testItCanGetSellingCurrency() + public function testItCanGetSellingCurrency(): void { $this->assertInstanceOf(Currency::class, $this->response->sellingCurrency()); } - public function testItCanGetSellingAmount() + public function testItCanGetSellingAmount(): void { $this->assertInstanceOf(Money::class, $this->response->sellingAmount()); $this->assertEquals(0, $this->response->sellingAmount()->getAmount()); } - public function testItCanGetUnutilisedSellingAmount() + public function testItCanGetUnutilisedSellingAmount(): void { $this->assertInstanceOf(Money::class, $this->response->unutilisedSellingAmount()); $this->assertEquals(0, $this->response->unutilisedSellingAmount()->getAmount()); } - public function testItCanGetCustomerId() + public function testItCanGetCustomerId(): void { $this->assertEquals(17824872, $this->response->customerId()); } diff --git a/tests/unit/Orders/Domains/Responses/RenewalResponseTest.php b/tests/unit/Orders/Domains/Responses/RenewalResponseTest.php index 6eb64d8..3eb0d11 100644 --- a/tests/unit/Orders/Domains/Responses/RenewalResponseTest.php +++ b/tests/unit/Orders/Domains/Responses/RenewalResponseTest.php @@ -17,7 +17,7 @@ class RenewalResponseTest extends TestCase */ private $response; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -43,17 +43,17 @@ protected function setUp() ]); } - public function testItCanOrderId() + public function testItCanOrderId(): void { $this->assertEquals(85547813, $this->response->orderId()); } - public function testItCanGetDescription() + public function testItCanGetDescription(): void { $this->assertEquals('yesterday.co.in', $this->response->description()); } - public function testItCanGetAction() + public function testItCanGetAction(): void { $action = $this->response->action(); $this->assertInstanceOf(Action::class, $action); @@ -64,39 +64,39 @@ public function testItCanGetAction() $this->assertEquals('Domain renewed successfully', $action->statusDescription()); } - public function testItCanGetInvoiceId() + public function testItCanGetInvoiceId(): void { $this->assertEquals(88713188, $this->response->invoiceId()); } - public function testItCanGetSellingCurrencySymbol() + public function testItCanGetSellingCurrencySymbol(): void { $this->assertEquals('GBP', $this->response->sellingCurrencySymbol()); } - public function testItCanGetSellingCurrency() + public function testItCanGetSellingCurrency(): void { $this->assertInstanceOf(Currency::class, $this->response->sellingCurrency()); } - public function testItCanGetSellingAmount() + public function testItCanGetSellingAmount(): void { $this->assertInstanceOf(Money::class, $this->response->sellingAmount()); $this->assertEquals(-791, $this->response->sellingAmount()->getAmount()); } - public function testItCanGetUnutilisedSellingAmount() + public function testItCanGetUnutilisedSellingAmount(): void { $this->assertInstanceOf(Money::class, $this->response->unutilisedSellingAmount()); $this->assertEquals(-791, $this->response->unutilisedSellingAmount()->getAmount()); } - public function testItCanGetCustomerId() + public function testItCanGetCustomerId(): void { $this->assertEquals(17824872, $this->response->customerId()); } - public function testItCanGetPrivacyProtectionDetails() + public function testItCanGetPrivacyProtectionDetails(): void { $response = new RenewalResponse([ 'privacydetails' => [ diff --git a/tests/unit/Orders/EmailAccounts/EmailAccountTest.php b/tests/unit/Orders/EmailAccounts/EmailAccountTest.php index 4be74b9..d715545 100644 --- a/tests/unit/Orders/EmailAccounts/EmailAccountTest.php +++ b/tests/unit/Orders/EmailAccounts/EmailAccountTest.php @@ -19,7 +19,7 @@ class EmailAccountTest extends TestCase { - public function testResponseFromEmailAccountDelete() + public function testResponseFromEmailAccountDelete(): void { $mock = new MockHandler([ new Response( @@ -46,7 +46,7 @@ public function testResponseFromEmailAccountDelete() ); } - public function testResponseFromEmailAccountCreate() + public function testResponseFromEmailAccountCreate(): void { $mock = new MockHandler([ new Response( diff --git a/tests/unit/Orders/EmailAccounts/Requests/CreateRequestTest.php b/tests/unit/Orders/EmailAccounts/Requests/CreateRequestTest.php index fdbe8b2..045f586 100644 --- a/tests/unit/Orders/EmailAccounts/Requests/CreateRequestTest.php +++ b/tests/unit/Orders/EmailAccounts/Requests/CreateRequestTest.php @@ -14,7 +14,7 @@ class CreateRequestTest extends TestCase */ private $request; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -33,44 +33,44 @@ protected function setUp() ); } - public function testOrderId() + public function testOrderId(): void { $this->assertEquals(123, $this->request->orderId()); } - public function testEmail() + public function testEmail(): void { $this->assertInstanceOf(EmailAddress::class, $this->request->email()); $this->assertEquals('john.doe@my-domain.co.uk', (string) $this->request->email()); } - public function testPassword() + public function testPassword(): void { $this->assertEquals('myT35tP@55word', $this->request->password()); } - public function testNotificationEmail() + public function testNotificationEmail(): void { $this->assertInstanceOf(EmailAddress::class, $this->request->notificationEmail()); $this->assertEquals('alternative@test.com', (string) $this->request->notificationEmail()); } - public function testFirstName() + public function testFirstName(): void { $this->assertEquals('John', $this->request->firstName()); } - public function testLastName() + public function testLastName(): void { $this->assertEquals('Doe', $this->request->lastName()); } - public function testCountryCode() + public function testCountryCode(): void { $this->assertEquals('US', $this->request->countryCode()); } - public function testLanguageCode() + public function testLanguageCode(): void { $this->assertEquals('en', $this->request->languageCode()); } diff --git a/tests/unit/Orders/EmailAccounts/Requests/DeleteRequestTest.php b/tests/unit/Orders/EmailAccounts/Requests/DeleteRequestTest.php index feca88f..fad90f2 100644 --- a/tests/unit/Orders/EmailAccounts/Requests/DeleteRequestTest.php +++ b/tests/unit/Orders/EmailAccounts/Requests/DeleteRequestTest.php @@ -14,7 +14,7 @@ class DeleteRequestTest extends TestCase */ private $request; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -26,12 +26,12 @@ protected function setUp() ); } - public function testOrderId() + public function testOrderId(): void { $this->assertEquals(123, $this->request->orderId()); } - public function testEmail() + public function testEmail(): void { $this->assertEquals('john.doe@my-domain.co.uk', $this->request->email()); } diff --git a/tests/unit/Orders/EmailAccounts/Responses/CreateResponseTest.php b/tests/unit/Orders/EmailAccounts/Responses/CreateResponseTest.php index fbaa20a..56f2e6d 100644 --- a/tests/unit/Orders/EmailAccounts/Responses/CreateResponseTest.php +++ b/tests/unit/Orders/EmailAccounts/Responses/CreateResponseTest.php @@ -16,7 +16,7 @@ class CreateResponseTest extends TestCase { - public function testResponseExceptionThrownWhenValidationErrorIsReturn() + public function testResponseExceptionThrownWhenValidationErrorIsReturn(): void { try { new CreateResponse(['response' => [ @@ -33,7 +33,7 @@ public function testResponseExceptionThrownWhenValidationErrorIsReturn() $this->fail('The missing attribute exception was not thrown for the user.'); } - public function testMissingAttributeExceptionThrownWhenUserNotSetInResponse() + public function testMissingAttributeExceptionThrownWhenUserNotSetInResponse(): void { try { new CreateResponse([ @@ -50,7 +50,7 @@ public function testMissingAttributeExceptionThrownWhenUserNotSetInResponse() $this->fail('The missing attribute exception was not thrown for the user.'); } - public function testStatus() + public function testStatus(): void { $response = new CreateResponse([ 'response' => [ @@ -63,7 +63,7 @@ public function testStatus() $this->assertEquals('success', (string) $response->status()); } - public function testStatusNotSetInResponse() + public function testStatusNotSetInResponse(): void { try { $response = new CreateResponse([ @@ -81,7 +81,7 @@ public function testStatusNotSetInResponse() $this->fail('The missing attribute exception was not thrown for the status.'); } - public function testEmail() + public function testEmail(): void { $response = new CreateResponse([ 'response' => [ @@ -96,7 +96,7 @@ public function testEmail() $this->assertEquals('john.does@some-domain.co.uk', (string) $response->email()); } - public function testDomain() + public function testDomain(): void { $response = new CreateResponse([ 'response' => [ @@ -107,11 +107,11 @@ public function testDomain() ], ]); - $this->assertInternalType('string', $response->domain()); + $this->assertIsString($response->domain()); $this->assertEquals('some-domain.co.uk', $response->domain()); } - public function testFirstName() + public function testFirstName(): void { $response = new CreateResponse([ 'response' => [ @@ -122,11 +122,11 @@ public function testFirstName() ], ]); - $this->assertInternalType('string', $response->firstName()); + $this->assertIsString($response->firstName()); $this->assertEquals('John', $response->firstName()); } - public function testLastName() + public function testLastName(): void { $response = new CreateResponse([ 'response' => [ @@ -137,11 +137,11 @@ public function testLastName() ], ]); - $this->assertInternalType('string', $response->lastName()); + $this->assertIsString($response->lastName()); $this->assertEquals('Doe', $response->lastName()); } - public function testNotificationsEmail() + public function testNotificationsEmail(): void { $response = new CreateResponse([ 'response' => [ @@ -156,7 +156,7 @@ public function testNotificationsEmail() $this->assertEquals('another-email@some-domain.co.uk', (string) $response->notificationsEmail()); } - public function testInternalForwards() + public function testInternalForwards(): void { $expected_result = 'new:somedomain.co.in.onlyfordemo.com@set25.mss.mailhostbox.aus-tx.colo'; @@ -169,11 +169,11 @@ public function testInternalForwards() ], ]); - $this->assertInternalType('string', $response->internalForwards()); + $this->assertIsString($response->internalForwards()); $this->assertEquals($expected_result, $response->internalForwards()); } - public function testQuotaLimit() + public function testQuotaLimit(): void { $response = new CreateResponse([ 'response' => [ @@ -184,11 +184,11 @@ public function testQuotaLimit() ], ]); - $this->assertInternalType('int', $response->quotaLimit()); + $this->assertIsInt($response->quotaLimit()); $this->assertEquals(5242880, $response->quotaLimit()); } - public function testAccountStatus() + public function testAccountStatus(): void { $response = new CreateResponse([ 'response' => [ @@ -199,11 +199,11 @@ public function testAccountStatus() ], ]); - $this->assertInternalType('string', $response->accountStatus()); + $this->assertIsString($response->accountStatus()); $this->assertEquals('active', $response->accountStatus()); } - public function testAccountType() + public function testAccountType(): void { $response = new CreateResponse([ 'response' => [ @@ -214,11 +214,11 @@ public function testAccountType() ], ]); - $this->assertInternalType('string', $response->accountType()); + $this->assertIsString($response->accountType()); $this->assertEquals('POP_WITHOUT_AUTORESPONDER', $response->accountType()); } - public function testQuotaUsed() + public function testQuotaUsed(): void { $response = new CreateResponse([ 'response' => [ @@ -229,11 +229,11 @@ public function testQuotaUsed() ], ]); - $this->assertInternalType('int', $response->quotaUsed()); + $this->assertIsInt($response->quotaUsed()); $this->assertEquals(0, $response->quotaUsed()); } - public function testCountryCode() + public function testCountryCode(): void { $response = new CreateResponse([ 'response' => [ @@ -244,11 +244,11 @@ public function testCountryCode() ], ]); - $this->assertInternalType('string', $response->countryCode()); + $this->assertIsString($response->countryCode()); $this->assertEquals('US', $response->countryCode()); } - public function testPercentageQuotaUsage() + public function testPercentageQuotaUsage(): void { $response = new CreateResponse([ 'response' => [ @@ -259,11 +259,11 @@ public function testPercentageQuotaUsage() ], ]); - $this->assertInternalType('float', $response->percentageQuotaUsage()); + $this->assertIsFloat($response->percentageQuotaUsage()); $this->assertEquals(0, $response->percentageQuotaUsage()); } - public function testLanguageCode() + public function testLanguageCode(): void { $response = new CreateResponse([ 'response' => [ @@ -274,11 +274,11 @@ public function testLanguageCode() ], ]); - $this->assertInternalType('string', $response->languageCode()); + $this->assertIsString($response->languageCode()); $this->assertEquals('en', $response->languageCode()); } - public function testAccountSettings() + public function testAccountSettings(): void { $response = new CreateResponse([ 'response' => [ @@ -296,7 +296,7 @@ public function testAccountSettings() $accountSettings = $response->accountSettings(); - $this->assertInternalType('array', $accountSettings); + $this->assertIsArray($accountSettings); $this->assertCount(4, $accountSettings); $this->assertArrayHasKey('pop', $accountSettings); @@ -310,7 +310,7 @@ public function testAccountSettings() $this->assertInstanceOf(WebmailUrlSettings::class, $accountSettings['webmail']); } - public function testCreatedOn() + public function testCreatedOn(): void { $response = new CreateResponse([ 'response' => [ @@ -325,7 +325,7 @@ public function testCreatedOn() $this->assertEquals('2017-11-10 17:45:17', $response->createdOn()->format('Y-m-d H:i:s')); } - public function testPopAccessEnabled() + public function testPopAccessEnabled(): void { $response = new CreateResponse([ 'response' => [ @@ -336,11 +336,11 @@ public function testPopAccessEnabled() ], ]); - $this->assertInternalType('bool', $response->popAccessEnabled()); + $this->assertIsBool($response->popAccessEnabled()); $this->assertTrue($response->popAccessEnabled()); } - public function testImapAccessEnabled() + public function testImapAccessEnabled(): void { $response = new CreateResponse([ 'response' => [ @@ -351,11 +351,11 @@ public function testImapAccessEnabled() ], ]); - $this->assertInternalType('bool', $response->imapAccessEnabled()); + $this->assertIsBool($response->imapAccessEnabled()); $this->assertTrue($response->imapAccessEnabled()); } - public function testWebmailAccessEnabled() + public function testWebmailAccessEnabled(): void { $response = new CreateResponse([ 'response' => [ @@ -366,11 +366,11 @@ public function testWebmailAccessEnabled() ], ]); - $this->assertInternalType('bool', $response->webmailAccessEnabled()); + $this->assertIsBool($response->webmailAccessEnabled()); $this->assertTrue($response->webmailAccessEnabled()); } - public function testCanFooterOptout() + public function testCanFooterOptout(): void { $response = new CreateResponse([ 'response' => [ @@ -381,11 +381,11 @@ public function testCanFooterOptout() ], ]); - $this->assertInternalType('bool', $response->canFooterOptout()); + $this->assertIsBool($response->canFooterOptout()); $this->assertFalse($response->canFooterOptout()); } - public function testRevertBlacklistRequestExists() + public function testRevertBlacklistRequestExists(): void { $response = new CreateResponse([ 'response' => [ @@ -396,11 +396,11 @@ public function testRevertBlacklistRequestExists() ], ]); - $this->assertInternalType('bool', $response->revertBlacklistRequestExists()); + $this->assertIsBool($response->revertBlacklistRequestExists()); $this->assertFalse($response->revertBlacklistRequestExists()); } - public function testConfigurationProfile() + public function testConfigurationProfile(): void { $response = new CreateResponse([ 'response' => [ @@ -411,7 +411,7 @@ public function testConfigurationProfile() ], ]); - $this->assertInternalType('string', $response->configurationProfile()); + $this->assertIsString($response->configurationProfile()); $this->assertEquals('EELITE', $response->configurationProfile()); } } diff --git a/tests/unit/Orders/EmailAccounts/Responses/DeletedResponseTest.php b/tests/unit/Orders/EmailAccounts/Responses/DeletedResponseTest.php index 81bc5d0..e207ac7 100644 --- a/tests/unit/Orders/EmailAccounts/Responses/DeletedResponseTest.php +++ b/tests/unit/Orders/EmailAccounts/Responses/DeletedResponseTest.php @@ -11,7 +11,7 @@ class DeletedResponseTest extends TestCase { - public function testMissingAttributeExceptionThrownWhenStatusNotSetInResponse() + public function testMissingAttributeExceptionThrownWhenStatusNotSetInResponse(): void { try { new DeletedResponse(['response' => []]); @@ -24,7 +24,7 @@ public function testMissingAttributeExceptionThrownWhenStatusNotSetInResponse() $this->fail('The missing attribute exception has not been thrown.'); } - public function testStatusSet() + public function testStatusSet(): void { $response = new DeletedResponse([ 'response' => ['status' => 'SUCCESS'], @@ -34,7 +34,7 @@ public function testStatusSet() $this->assertEquals('success', (string) $response->status()); } - public function testDoesNotExistResponseThrownWhenEmailAddressErrorCodeFound() + public function testDoesNotExistResponseThrownWhenEmailAddressErrorCodeFound(): void { $this->expectException(DoesNotExistResponseException::class); new DeletedResponse([ @@ -46,7 +46,7 @@ public function testDoesNotExistResponseThrownWhenEmailAddressErrorCodeFound() ]); } - public function testResponseExceptionThrownWhenNotSuccessful() + public function testResponseExceptionThrownWhenNotSuccessful(): void { try { new DeletedResponse([ diff --git a/tests/unit/Orders/EmailAccounts/Settings/ImapSettingsTest.php b/tests/unit/Orders/EmailAccounts/Settings/ImapSettingsTest.php index 21a470a..ab1865b 100644 --- a/tests/unit/Orders/EmailAccounts/Settings/ImapSettingsTest.php +++ b/tests/unit/Orders/EmailAccounts/Settings/ImapSettingsTest.php @@ -7,7 +7,7 @@ class ImapSettingsTest extends TestCase { - public function testImapSettings() + public function testImapSettings(): void { $imapSettings = new ImapSettings('imap.somedomain.co.in.onlyfordemo.com'); diff --git a/tests/unit/Orders/EmailAccounts/Settings/PopSettingsTest.php b/tests/unit/Orders/EmailAccounts/Settings/PopSettingsTest.php index 2c3c4f1..c628133 100644 --- a/tests/unit/Orders/EmailAccounts/Settings/PopSettingsTest.php +++ b/tests/unit/Orders/EmailAccounts/Settings/PopSettingsTest.php @@ -7,7 +7,7 @@ class PopSettingsTest extends TestCase { - public function testPopSettings() + public function testPopSettings(): void { $popSettings = new PopSettings('pop.somedomain.co.in.onlyfordemo.com'); diff --git a/tests/unit/Orders/EmailAccounts/Settings/SmtpSettingsTest.php b/tests/unit/Orders/EmailAccounts/Settings/SmtpSettingsTest.php index f78d31a..6e46be1 100644 --- a/tests/unit/Orders/EmailAccounts/Settings/SmtpSettingsTest.php +++ b/tests/unit/Orders/EmailAccounts/Settings/SmtpSettingsTest.php @@ -7,7 +7,7 @@ class SmtpSettingsTest extends TestCase { - public function testImapSettings() + public function testImapSettings(): void { $smtpSettings = new SmtpSettings('smtp.somedomain.co.in.onlyfordemo.com'); diff --git a/tests/unit/Orders/EmailAccounts/Settings/WebmailUrlSettingsTest.php b/tests/unit/Orders/EmailAccounts/Settings/WebmailUrlSettingsTest.php index 56caff8..826bc64 100644 --- a/tests/unit/Orders/EmailAccounts/Settings/WebmailUrlSettingsTest.php +++ b/tests/unit/Orders/EmailAccounts/Settings/WebmailUrlSettingsTest.php @@ -7,7 +7,7 @@ class WebmailUrlSettingsTest extends TestCase { - public function testWebmailUrlSettings() + public function testWebmailUrlSettings(): void { $webmailUrlSettings = new WebmailUrlSettings('http://webmail.somedomain.co.in.onlyfordemo.com'); diff --git a/tests/unit/Orders/EmailForwarders/EmailForwarderTest.php b/tests/unit/Orders/EmailForwarders/EmailForwarderTest.php index f8eb31b..ed8dea6 100644 --- a/tests/unit/Orders/EmailForwarders/EmailForwarderTest.php +++ b/tests/unit/Orders/EmailForwarders/EmailForwarderTest.php @@ -17,7 +17,7 @@ class EmailForwarderTest extends TestCase { - public function testResponseFromEmailForwarderDelete() + public function testResponseFromEmailForwarderDelete(): void { $mock = new MockHandler([ new Response( diff --git a/tests/unit/Orders/EmailForwarders/Requests/CreateRequestTest.php b/tests/unit/Orders/EmailForwarders/Requests/CreateRequestTest.php index f9667b6..3e1a243 100644 --- a/tests/unit/Orders/EmailForwarders/Requests/CreateRequestTest.php +++ b/tests/unit/Orders/EmailForwarders/Requests/CreateRequestTest.php @@ -14,7 +14,7 @@ class CreateRequestTest extends TestCase */ private $request; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -28,9 +28,9 @@ protected function setUp() ]); } - public function testItCanGetOrderId() + public function testItCanGetOrderId(): void { - $this->assertInternalType('integer', $this->request->orderId()); + $this->assertIsInt($this->request->orderId()); $this->assertEquals(123, $this->request->orderId()); } @@ -41,7 +41,7 @@ public function testItCanGetEmail() public function testItCanGetForwarders() { - $this->assertInternalType('string', $this->request->forwarders()); + $this->assertIsString($this->request->forwarders()); $this->assertEquals( 'john.doe@example.com,jane.doe@example.com', $this->request->forwarders() diff --git a/tests/unit/Orders/EmailForwarders/Responses/CreateResponseTest.php b/tests/unit/Orders/EmailForwarders/Responses/CreateResponseTest.php index bf0d654..0079d31 100644 --- a/tests/unit/Orders/EmailForwarders/Responses/CreateResponseTest.php +++ b/tests/unit/Orders/EmailForwarders/Responses/CreateResponseTest.php @@ -13,7 +13,7 @@ class CreateResponseTest extends TestCase */ private $response; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -24,7 +24,7 @@ protected function setUp() ]); } - public function testItCanGetStatus() + public function testItCanGetStatus(): void { $this->assertInstanceOf(Status::class, $this->response->status()); $this->assertEquals('success', (string) $this->response->status()); diff --git a/tests/unit/Orders/GdprProtectionTest.php b/tests/unit/Orders/GdprProtectionTest.php index f201003..2feac21 100644 --- a/tests/unit/Orders/GdprProtectionTest.php +++ b/tests/unit/Orders/GdprProtectionTest.php @@ -7,7 +7,7 @@ class GdprProtectionTest extends TestCase { - public function testEnabledAndDisabled() + public function testEnabledAndDisabled(): void { $this->assertTrue( (new GdprProtection( @@ -38,7 +38,7 @@ public function testEnabledAndDisabled() ); } - public function testEligibility() + public function testEligibility(): void { $this->assertTrue( (new GdprProtection( diff --git a/tests/unit/Orders/InvoiceOptionTest.php b/tests/unit/Orders/InvoiceOptionTest.php index 05e7d7c..08de63c 100644 --- a/tests/unit/Orders/InvoiceOptionTest.php +++ b/tests/unit/Orders/InvoiceOptionTest.php @@ -7,7 +7,7 @@ class InvoiceOptionTest extends TestCase { - public function testValidStatuses() + public function testValidStatuses(): void { $this->assertEquals('NoInvoice', (string) InvoiceOption::noInvoice()); $this->assertEquals('PayInvoice', (string) InvoiceOption::payInvoice()); diff --git a/tests/unit/Orders/LockedOrHoldStatusTest.php b/tests/unit/Orders/LockedOrHoldStatusTest.php index c18e9e4..1a7e81d 100644 --- a/tests/unit/Orders/LockedOrHoldStatusTest.php +++ b/tests/unit/Orders/LockedOrHoldStatusTest.php @@ -7,25 +7,25 @@ class LockedOrHoldStatusTest extends TestCase { - public function testObjectToString() + public function testObjectToString(): void { $this->assertEquals('sixtydaylock', (string) new LockedOrHoldStatus('sixtydaylock')); $this->assertEquals('', (string) new LockedOrHoldStatus('')); } - public function testIsLocked() + public function testIsLocked(): void { $this->assertTrue((new LockedOrHoldStatus('sixtydaylock'))->isLocked()); $this->assertFalse((new LockedOrHoldStatus('not_locked_status'))->isLocked()); } - public function testIsOnHold() + public function testIsOnHold(): void { $this->assertTrue((new LockedOrHoldStatus('renewhold'))->isOnHold()); $this->assertFalse((new LockedOrHoldStatus('not_on_hold_status'))->isOnHold()); } - public function testIsLockedOrOnHold() + public function testIsLockedOrOnHold(): void { $this->assertTrue((new LockedOrHoldStatus('sixtydaylock'))->isLockedOrOnHold()); $this->assertTrue((new LockedOrHoldStatus('renewhold'))->isLockedOrOnHold()); diff --git a/tests/unit/Orders/OrderStatusTest.php b/tests/unit/Orders/OrderStatusTest.php index e7e7641..137e166 100644 --- a/tests/unit/Orders/OrderStatusTest.php +++ b/tests/unit/Orders/OrderStatusTest.php @@ -7,38 +7,38 @@ class OrderStatusTest extends TestCase { - public function testToStringConvertsToLowercase() + public function testToStringConvertsToLowercase(): void { $this->assertEquals('active', (string) new OrderStatus('Active')); $this->assertEquals('active', (string) new OrderStatus('active')); $this->assertEquals('active', (string) new OrderStatus('ACTIVE')); } - public function testIsActive() + public function testIsActive(): void { $this->assertTrue((new OrderStatus('Active'))->isActive()); $this->assertFalse((new OrderStatus('Not active'))->isActive()); } - public function testIsInactive() + public function testIsInactive(): void { $this->assertTrue((new OrderStatus('inactive'))->isInactive()); $this->assertFalse((new OrderStatus('active'))->isInactive()); } - public function testIsPendingDeletion() + public function testIsPendingDeletion(): void { $this->assertTrue((new OrderStatus('pending delete restorable'))->isPendingDeletion()); $this->assertFalse((new OrderStatus('active'))->isPendingDeletion()); } - public function testIsDeleted() + public function testIsDeleted(): void { $this->assertTrue((new OrderStatus('Deleted'))->isDeleted()); $this->assertFalse((new OrderStatus('active'))->isDeleted()); } - public function testIsArchived() + public function testIsArchived(): void { $this->assertTrue((new OrderStatus('archived'))->isArchived()); $this->assertFalse((new OrderStatus('active'))->isArchived()); diff --git a/tests/unit/Orders/OrderTest.php b/tests/unit/Orders/OrderTest.php index 259f3df..4b0d7e7 100644 --- a/tests/unit/Orders/OrderTest.php +++ b/tests/unit/Orders/OrderTest.php @@ -7,11 +7,11 @@ class OrderTest extends TestCase { - public function testGettingIdWhenSet() + public function testGettingIdWhenSet(): void { $orderId = (new Order(123))->id(); - $this->assertInternalType('int', $orderId); + $this->assertIsInt($orderId); $this->assertEquals(123, $orderId); } } diff --git a/tests/unit/ResponseTest.php b/tests/unit/ResponseTest.php index f6f5eb1..59674ec 100644 --- a/tests/unit/ResponseTest.php +++ b/tests/unit/ResponseTest.php @@ -13,7 +13,7 @@ class ResponseTest extends TestCase { - public function testStatus() + public function testStatus(): void { $response = new Response( 200, @@ -28,7 +28,7 @@ public function testStatus() $this->assertEquals('success', CreateResponse::fromApiResponse($response)->status()); } - public function testMessage() + public function testMessage(): void { $message = 'The request executed successfully'; $response = new Response( @@ -44,7 +44,7 @@ public function testMessage() $this->assertEquals($message, UpdateResponse::fromApiResponse($response)->message()); } - public function wasSuccessful() + public function wasSuccessful(): void { $successfulResponse = new Response( 200, diff --git a/tests/unit/StatusTest.php b/tests/unit/StatusTest.php index 4b7b6ea..83f8938 100644 --- a/tests/unit/StatusTest.php +++ b/tests/unit/StatusTest.php @@ -7,7 +7,7 @@ class StatusTest extends TestCase { - public function testStatus() + public function testStatus(): void { $this->assertEquals('success', (string) new Status('Success')); $this->assertEquals('success', (string) new Status('SUCCESS')); diff --git a/tests/unit/TelephoneNumberTest.php b/tests/unit/TelephoneNumberTest.php index cf7e4cd..c4eb673 100644 --- a/tests/unit/TelephoneNumberTest.php +++ b/tests/unit/TelephoneNumberTest.php @@ -7,14 +7,14 @@ class TelephoneNumberTest extends TestCase { - public function testDiallingCode() + public function testDiallingCode(): void { $telephoneNumber = new TelephoneNumber( $diallingCode = '+44', $number = '00000000' ); - $this->assertInternalType('string', $telephoneNumber->diallingCode()); + $this->assertIsString($telephoneNumber->diallingCode()); $this->assertEquals('44', $telephoneNumber->diallingCode()); $telephoneNumber = new TelephoneNumber( @@ -22,18 +22,18 @@ public function testDiallingCode() $number = '00000000' ); - $this->assertInternalType('string', $telephoneNumber->diallingCode()); + $this->assertIsString($telephoneNumber->diallingCode()); $this->assertEquals('44', $telephoneNumber->diallingCode()); } - public function testNumber() + public function testNumber(): void { $telephoneNumber = new TelephoneNumber( $diallingCode = '00', $number = '0113 000 0000' ); - $this->assertInternalType('string', $telephoneNumber->number()); + $this->assertIsString($telephoneNumber->number()); $this->assertEquals('01130000000', $telephoneNumber->number()); $telephoneNumber = new TelephoneNumber( @@ -41,7 +41,7 @@ public function testNumber() $number = '0113-000-0000' ); - $this->assertInternalType('string', $telephoneNumber->number()); + $this->assertIsString($telephoneNumber->number()); $this->assertEquals('01130000000', $telephoneNumber->number()); $telephoneNumber = new TelephoneNumber( @@ -49,7 +49,7 @@ public function testNumber() $number = '01130000000' ); - $this->assertInternalType('string', $telephoneNumber->number()); + $this->assertIsString($telephoneNumber->number()); $this->assertEquals('01130000000', $telephoneNumber->number()); $telephoneNumber = new TelephoneNumber( @@ -57,7 +57,7 @@ public function testNumber() $number = '+441130000000' ); - $this->assertInternalType('string', $telephoneNumber->number()); + $this->assertIsString($telephoneNumber->number()); $this->assertEquals('441130000000', $telephoneNumber->number()); } } diff --git a/tests/unit/TimeToLiveTest.php b/tests/unit/TimeToLiveTest.php index 8fbff5f..9fd4ffd 100644 --- a/tests/unit/TimeToLiveTest.php +++ b/tests/unit/TimeToLiveTest.php @@ -9,51 +9,51 @@ class TimeToLiveTest extends TestCase { - public function testNonIntegerTTLThrowsException() + public function testNonIntegerTTLThrowsException(): void { $this->expectException(TypeError::class); new TimeToLive('three minutes'); } - public function testBelowMinimumTTLThrowsException() + public function testBelowMinimumTTLThrowsException(): void { $this->expectException(InvalidArgumentException::class); new TimeToLive('7199'); } - public function testEqualToMinimumTTLInstantiates() + public function testEqualToMinimumTTLInstantiates(): void { $ttl = new TimeToLive('7200'); $this->assertInstanceOf(TimeToLive::class, $ttl); } - public function testDefaultTTLHelper() + public function testDefaultTTLHelper(): void { $ttl = TimeToLive::defaultTtl(); $this->assertInstanceOf(TimeToLive::class, $ttl); $this->assertEquals(TimeToLive::DEFAULT_TTL, (string) $ttl); } - public function testMinimumTTLHelper() + public function testMinimumTTLHelper(): void { $ttl = TimeToLive::minimumTtl(); $this->assertInstanceOf(TimeToLive::class, $ttl); $this->assertEquals(TimeToLive::MINIMUM_TTL, (string) $ttl); } - public function testCastToString() + public function testCastToString(): void { $ttl = TimeToLive::defaultTtl(); - $this->assertInternalType('string', (string) $ttl); + $this->assertIsString((string) $ttl); $this->assertEquals(TimeToLive::DEFAULT_TTL, (string) $ttl); } - public function testIntegerFunction() + public function testIntegerFunction(): void { $ttl = TimeToLive::defaultTtl(); - $this->assertInternalType('integer', $ttl->integer()); + $this->assertIsInt($ttl->integer()); $this->assertEquals(TimeToLive::DEFAULT_TTL, $ttl->integer()); } }