-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
627fca2
commit 524ca92
Showing
12 changed files
with
134 additions
and
409 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
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 |
---|---|---|
|
@@ -2,12 +2,10 @@ | |
|
||
declare(strict_types=1); | ||
|
||
namespace CommonTest\Entity\Sirius; | ||
namespace CommonTest\Entity; | ||
|
||
use Common\Entity\Sirius\SiriusLpa; | ||
use Common\Entity\Sirius\SiriusLpaAttorney; | ||
use Common\Entity\Sirius\SiriusLpaDonor; | ||
use Common\Entity\Sirius\SiriusLpaTrustCorporations; | ||
use Common\Entity\CombinedLpa; | ||
use Common\Entity\Person; | ||
use Common\Enum\HowAttorneysMakeDecisions; | ||
use Common\Enum\WhenTheLpaCanBeUsed; | ||
use Common\Service\Lpa\Factory\LpaDataFormatter; | ||
|
@@ -17,7 +15,7 @@ | |
use PHPUnit\Framework\TestCase; | ||
use Prophecy\PhpUnit\ProphecyTrait; | ||
|
||
class CanHydrateSiriusToCombinedFormatTest extends TestCase | ||
class CanHydrateCombinedLpaTest extends TestCase | ||
{ | ||
use ProphecyTrait; | ||
|
||
|
@@ -28,108 +26,114 @@ public function setUp(): void | |
$this->lpaDataFormatter = new LpaDataFormatter(); | ||
} | ||
|
||
public function expectedSiriusLpa(): SiriusLpa | ||
public function expectedSiriusLpa(): CombinedLpa | ||
{ | ||
$donor = new SiriusLpaDonor( | ||
$donor = new Person( | ||
addressLine1 : '81 Front Street', | ||
addressLine2 : 'LACEBY', | ||
addressLine3 : '', | ||
country : '', | ||
county : '', | ||
dob : new DateTimeImmutable('1948-11-01'), | ||
email : '[email protected]', | ||
firstname : 'Rachel', | ||
firstnames : null, | ||
linked : [ | ||
[ | ||
'id' => 7, | ||
'uId' => '700000000799', | ||
], | ||
], | ||
name : null, | ||
otherNames : null, | ||
otherNames : 'Ezra', | ||
postcode : 'DN37 5SH', | ||
surname : 'Sanderson', | ||
systemStatus : null, | ||
town : '', | ||
type : 'Primary', | ||
uId : '700000000799' | ||
); | ||
|
||
$attorneys = [ | ||
new SiriusLpaAttorney( | ||
new Person( | ||
addressLine1 : '9 high street', | ||
addressLine2 : '', | ||
addressLine3 : '', | ||
country : '', | ||
county : '', | ||
dob : new DateTimeImmutable('1990-05-04'), | ||
email : '', | ||
firstname : 'jean', | ||
firstnames : null, | ||
name : null, | ||
otherNames : null, | ||
postcode : 'DN37 5SH', | ||
surname : 'sanderson', | ||
systemStatus : '1', | ||
town : '', | ||
type : 'Primary', | ||
uId : '700000000815' | ||
), | ||
new SiriusLpaAttorney( | ||
new Person( | ||
addressLine1 : '', | ||
addressLine2 : '', | ||
addressLine3 : '', | ||
country : '', | ||
county : '', | ||
dob : new DateTimeImmutable('1975-10-05'), | ||
email : 'XXXXX', | ||
firstname : 'Ann', | ||
firstnames : null, | ||
name : null, | ||
otherNames : null, | ||
postcode : '', | ||
surname : 'Summers', | ||
systemStatus : '1', | ||
town : '', | ||
type : 'Primary', | ||
uId : '7000-0000-0849' | ||
), | ||
]; | ||
|
||
$trustCorporations = [ | ||
new SiriusLpaTrustCorporations( | ||
new Person( | ||
addressLine1 : 'Street 1', | ||
addressLine2 : 'Street 2', | ||
addressLine3 : 'Street 3', | ||
country : 'GB', | ||
county : 'County', | ||
dob : null, | ||
email : null, | ||
firstname : 'trust', | ||
firstnames : null, | ||
name : 'trust corporation', | ||
otherNames : null, | ||
postcode : 'ABC 123', | ||
surname : 'test', | ||
systemStatus : '1', | ||
town : 'Town', | ||
type : 'Primary', | ||
uId : '7000-0015-1998', | ||
), | ||
]; | ||
|
||
return EntityTestHelper::makeSiriusLpa( | ||
$replacementAttorneys = [ | ||
new Person( | ||
addressLine1 : 'Address Line 1', | ||
addressLine2 : 'Address Line 2', | ||
addressLine3 : 'Address Line 3', | ||
country : 'Country', | ||
county : 'County', | ||
dob : new DateTimeImmutable('2000-01-31'), | ||
email : '[email protected]', | ||
firstnames : 'Firstnames', | ||
name : 'Name', | ||
otherNames : 'Other names', | ||
postcode : 'Postcode', | ||
surname : 'Surname', | ||
systemStatus : '1', | ||
town : 'Town', | ||
uId : '7000-0000-0849', | ||
), | ||
]; | ||
|
||
return EntityTestHelper::makeCombinedLpa( | ||
attorneys: $attorneys, | ||
channel: null, | ||
donor: $donor, | ||
howAttorneysMakeDecisions: HowAttorneysMakeDecisions::JOINTLY_AND_SEVERALLY, | ||
howAttorneysMakeDecisions: null, | ||
lpaDonorSignatureDate: new DateTimeImmutable('2012-12-12'), | ||
lpaIsCleansed: true, | ||
onlineLpaId: 'A33718377316', | ||
receiptDate: new DateTimeImmutable('2014-09-26'), | ||
registrationDate: new DateTimeImmutable('2019-10-10'), | ||
replacementAttorneys: [], | ||
replacementAttorneys: $replacementAttorneys, | ||
trustCorporations: $trustCorporations, | ||
uId: '700000000047', | ||
whenTheLpaCanBeUsed: WhenTheLpaCanBeUsed::WHEN_HAS_CAPACITY, | ||
|
@@ -139,7 +143,7 @@ public function expectedSiriusLpa(): SiriusLpa | |
#[Test] | ||
public function can_hydrate_sirius_lpa_to_modernise_format(): void | ||
{ | ||
$lpa = json_decode(file_get_contents(__DIR__ . '../../../../../test/fixtures/test_lpa.json'), true); | ||
$lpa = json_decode(file_get_contents(__DIR__ . '../../../../test/fixtures/combined_lpa.json'), true); | ||
|
||
$expectedSiriusLpa = $this->expectedSiriusLpa(); | ||
|
||
|
120 changes: 0 additions & 120 deletions
120
service-front/app/test/CommonTest/Entity/LpaStore/CanHydrateLpaStoreToCombinedFormatTest.php
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.