diff --git a/service-front/app/test/CommonTest/Service/Lpa/SiriusLpaFactoryTest.php b/service-front/app/test/CommonTest/Service/Lpa/SiriusLpaFactoryTest.php index 89db33ba8b..88e43e606c 100644 --- a/service-front/app/test/CommonTest/Service/Lpa/SiriusLpaFactoryTest.php +++ b/service-front/app/test/CommonTest/Service/Lpa/SiriusLpaFactoryTest.php @@ -130,6 +130,48 @@ public function can_create_lpa_from_simple_example(): void $this->assertEquals([0], $lpa->getDonor()->getIds()); } + /** + * @test + */ + public function can_hydrate_donor_from_simple_example(): void + { + $factory = new Sirius(); + + $lpa = $factory->createLpaFromData($this->simpleExampleFixtureData); + $donor = $lpa->getDonor(); + + $this->assertEquals(0, $donor->getId()); + $this->assertEquals('7000-0000-0054', $donor->getUId()); + $this->assertEquals('string', $donor->getEmail()); + $this->assertEquals('Mrs', $donor->getSalutation()); + $this->assertEquals('Ian', $donor->getFirstname()); + $this->assertEquals(null, $donor->getOtherNames()); + $this->assertEquals(null, $donor->getMiddlenames()); + $this->assertEquals('Deputy', $donor->getSurname()); + $this->assertEquals('ABC Ltd', $donor->getCompanyName()); + } + + /** + * @test + */ + public function can_hydrate_attorney_from_simple_example(): void + { + $factory = new Sirius(); + + $lpa = $factory->createLpaFromData($this->simpleExampleFixtureData); + $attorney = $lpa->getAttorneys()[0]; + + $this->assertEquals(0, $attorney->getId()); + $this->assertEquals('7000-0000-0054', $attorney->getUId()); + $this->assertEquals('string', $attorney->getEmail()); + $this->assertEquals('Mrs', $attorney->getSalutation()); + $this->assertEquals('Ian', $attorney->getFirstname()); + $this->assertEquals('George', $attorney->getOtherNames()); + $this->assertEquals('Deputy', $attorney->getMiddlenames()); + $this->assertEquals('Deputy', $attorney->getSurname()); + $this->assertEquals('ABC Ltd', $attorney->getCompanyName()); + } + /** * @test */ diff --git a/service-front/app/test/fixtures/full_example.json b/service-front/app/test/fixtures/full_example.json index ad82521939..0ee7d679c3 100644 --- a/service-front/app/test/fixtures/full_example.json +++ b/service-front/app/test/fixtures/full_example.json @@ -27,6 +27,7 @@ "dob": "1980-10-10", "salutation": "Mrs", "firstname": "Ian", + "otherNames": "George", "middlenames": "Deputy", "surname": "Deputy", "companyName": "ABC Ltd", @@ -52,6 +53,7 @@ "dob": "1975-10-05", "salutation": "Mrs", "firstname": "Ian", + "otherNames": "George", "middlenames": "Deputy", "surname": "Deputy", "companyName": "ABC Ltd", @@ -77,6 +79,7 @@ "email": "string", "salutation": "Mr", "firstname": "Simon", + "otherNames": null, "middlenames": null, "surname": "Matthews", "companyName": null, @@ -102,6 +105,7 @@ "email": "string", "salutation": "Mr", "firstname": "Harold", + "otherNames": null, "middlenames": null, "surname": "Stallman", "companyName": null, @@ -129,6 +133,7 @@ "dob": "1980-10-10", "salutation": "Mrs", "firstname": "Ian", + "otherNames": "George", "middlenames": "Deputy", "surname": "Deputy", "companyName": "ABC Ltd", @@ -155,6 +160,7 @@ "dob": "1980-10-10", "salutation": "Mrs", "firstname": "Ian", + "otherNames": "George", "middlenames": "Deputy", "surname": "Deputy", "companyName": "ABC Ltd", @@ -181,6 +187,7 @@ "dob": "1980-10-10", "salutation": "Mrs", "firstname": "Ian", + "otherNames": "George", "middlenames": "Deputy", "surname": "Deputy", "companyName": "ABC Ltd", diff --git a/service-front/app/test/fixtures/full_example_signed_before_2016.json b/service-front/app/test/fixtures/full_example_signed_before_2016.json index 75150f4fdd..c55c371de6 100644 --- a/service-front/app/test/fixtures/full_example_signed_before_2016.json +++ b/service-front/app/test/fixtures/full_example_signed_before_2016.json @@ -26,6 +26,7 @@ "dob": "1980-10-10", "salutation": "Mrs", "firstname": "Ian", + "otherNames": "George", "middlenames": "Deputy", "surname": "Deputy", "companyName": "ABC Ltd", @@ -51,6 +52,7 @@ "dob": "1975-10-05", "salutation": "Mrs", "firstname": "Ian", + "otherNames": "George", "middlenames": "Deputy", "surname": "Deputy", "companyName": "ABC Ltd", @@ -76,6 +78,7 @@ "email": "string", "salutation": "Mr", "firstname": "Simon", + "otherNames": null, "middlenames": null, "surname": "Matthews", "companyName": null, @@ -101,6 +104,7 @@ "email": "string", "salutation": "Mr", "firstname": "Harold", + "otherNames": null, "middlenames": null, "surname": "Stallman", "companyName": null, @@ -128,6 +132,7 @@ "dob": "1980-10-10", "salutation": "Mrs", "firstname": "Ian", + "otherNames": "George", "middlenames": "Deputy", "surname": "Deputy", "companyName": "ABC Ltd", @@ -154,6 +159,7 @@ "dob": "1980-10-10", "salutation": "Mrs", "firstname": "Ian", + "otherNames": "George", "middlenames": "Deputy", "surname": "Deputy", "companyName": "ABC Ltd", @@ -180,6 +186,7 @@ "dob": "1980-10-10", "salutation": "Mrs", "firstname": "Ian", + "otherNames": "George", "middlenames": "Deputy", "surname": "Deputy", "companyName": "ABC Ltd", diff --git a/service-front/app/test/fixtures/simple_example.json b/service-front/app/test/fixtures/simple_example.json index b722a6eb0c..0aaf437fb8 100644 --- a/service-front/app/test/fixtures/simple_example.json +++ b/service-front/app/test/fixtures/simple_example.json @@ -26,6 +26,7 @@ "dob": "1980-10-10", "salutation": "Mrs", "firstname": "Ian", + "otherNames": null, "middlenames": null, "surname": "Deputy", "companyName": "ABC Ltd", @@ -51,6 +52,7 @@ "dob": "1980-10-10", "salutation": "Mrs", "firstname": "Ian", + "otherNames": "George", "middlenames": "Deputy", "surname": "Deputy", "companyName": "ABC Ltd",