-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
491 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,9 @@ language: php | |
sudo: false | ||
|
||
php: | ||
- 7.0 | ||
- 7.1 | ||
- 7.2 | ||
- 7.3 | ||
- 7.4 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
namespace Test\Entity\Common; | ||
|
||
use LevelFive\CompaniesHouse\Entity\Common\Address; | ||
use PHPStan\Testing\TestCase; | ||
|
||
class AddressTest extends TestCase | ||
{ | ||
public function testAddress() | ||
{ | ||
$response = [ | ||
'address_line_1' => '10 Downing Street', | ||
'address_line_2' => 'London', | ||
'locality' => 'London.', | ||
'region' => 'Greater London', | ||
'postal_code' => 'SW1 3WQ', | ||
'country' => 'United Kingdom', | ||
'po_box' => 'POBOX 1003', | ||
'premises' => 'Building', | ||
'care_of' => 'test', | ||
]; | ||
|
||
$address = new Address($response); | ||
|
||
self::assertEquals($response['address_line_1'], $address->getFirstLine()); | ||
self::assertEquals($response['address_line_2'], $address->getSecondLine()); | ||
self::assertEquals($response['locality'], $address->getLocality()); | ||
self::assertEquals($response['region'], $address->getRegion()); | ||
self::assertEquals($response['postal_code'], $address->getPostalCode()); | ||
self::assertEquals($response['country'], $address->getCountry()); | ||
self::assertEquals($response['po_box'], $address->getPoBox()); | ||
self::assertEquals($response['premises'], $address->getPremises()); | ||
self::assertEquals($response['care_of'], $address->getCareOf()); | ||
|
||
self::assertEquals($response, $address->getRawResponse()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
namespace Test\Entity\Common; | ||
|
||
use LevelFive\CompaniesHouse\Entity\Common\DateOfBirth; | ||
use PHPStan\Testing\TestCase; | ||
|
||
class DateOfBirthTest extends TestCase | ||
{ | ||
public function testDateOfBirth() | ||
{ | ||
$response = [ | ||
'day' => '21', | ||
'month' => '03', | ||
'year' => '1979', | ||
]; | ||
|
||
$dateOfBirth = new DateOfBirth($response); | ||
|
||
self::assertEquals($response['day'], $dateOfBirth->getDay()); | ||
self::assertEquals($response['month'], $dateOfBirth->getMonth()); | ||
self::assertEquals($response['year'], $dateOfBirth->getYear()); | ||
self::assertEquals('21/03/1979', $dateOfBirth->getDateOfBirth()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
namespace Test\Entity\Common; | ||
|
||
use LevelFive\CompaniesHouse\Entity\Common\Identification; | ||
use PHPStan\Testing\TestCase; | ||
|
||
class IdentificationTest extends TestCase | ||
{ | ||
public function testIdentification() | ||
{ | ||
$response = [ | ||
'identification_type' => 'passport', | ||
'legal_authority' => 'UK', | ||
'legal_form' => 'EN11', | ||
'place_registered' => 'London', | ||
'registration_number' => '123123123213', | ||
]; | ||
|
||
$identification = new Identification($response); | ||
|
||
self::assertEquals($response['identification_type'], $identification->getIdentificationType()); | ||
self::assertEquals($response['legal_authority'], $identification->getLegalAuthority()); | ||
self::assertEquals($response['legal_form'], $identification->getLegalForm()); | ||
self::assertEquals($response['place_registered'], $identification->getPlaceRegistered()); | ||
self::assertEquals($response['registration_number'], $identification->getRegistrationNumber()); | ||
|
||
} | ||
} |
Oops, something went wrong.