diff --git a/src/Service/BpnXmlAnonymizer.php b/src/Service/BpnXmlAnonymizer.php index 2e8ee44..c6f9827 100644 --- a/src/Service/BpnXmlAnonymizer.php +++ b/src/Service/BpnXmlAnonymizer.php @@ -202,8 +202,6 @@ class BpnXmlAnonymizer $title = ''; $gender = 'D'; $nationality = 'XX'; - $birthDate = '01.01.1980'; - $street = sprintf('%s %s', $this->faker->streetName(), $this->faker->buildingNumber()); $postalCode = $this->faker->postcode(); $city = $this->faker->city(); @@ -232,7 +230,6 @@ class BpnXmlAnonymizer 'title' => $title, 'gender' => $gender, 'nationality' => $nationality, - 'birthDate' => $birthDate, 'street' => $street, 'postalCode' => $postalCode, 'city' => $city, @@ -389,11 +386,6 @@ class BpnXmlAnonymizer $this->replaceNodeValue($nationalityNode, $identity['nationality']); } - $birthDateNode = $this->getDirectChild($personNode, 'geburtsdatum'); - if (null !== $birthDateNode) { - $this->replaceNodeValue($birthDateNode, $identity['birthDate']); - } - $heightNode = $this->getDirectChild($personNode, 'sonstiges1'); if (null !== $heightNode) { $this->replaceNodeValue($heightNode, $identity['height']); diff --git a/tests/Service/BpnXmlAnonymizerTest.php b/tests/Service/BpnXmlAnonymizerTest.php index 0c93f9f..44f34a4 100644 --- a/tests/Service/BpnXmlAnonymizerTest.php +++ b/tests/Service/BpnXmlAnonymizerTest.php @@ -17,6 +17,7 @@ class BpnXmlAnonymizerTest extends TestCase Example Ava + 03.04.1991 Testallee 7 10115 @@ -32,6 +33,7 @@ class BpnXmlAnonymizerTest extends TestCase Example Ava + 03.04.1991 Testallee 7 10115 @@ -46,6 +48,7 @@ class BpnXmlAnonymizerTest extends TestCase Second Ben + 12.11.1987 ben.second@example.test @@ -69,6 +72,9 @@ XML; $applicantMobilePhone = trim((string) $xpath->evaluate('string(//anmelder/kommunikation/telefonmobil)')); $participantOneMobilePhone = trim((string) $xpath->evaluate('string(//teilnehmer[1]/kommunikation/telefonmobil)')); $participantTwoName = trim((string) $xpath->evaluate('string(//teilnehmer[2]/name)')); + $applicantBirthDate = trim((string) $xpath->evaluate('string(//anmelder/geburtsdatum)')); + $participantOneBirthDate = trim((string) $xpath->evaluate('string(//teilnehmer[1]/geburtsdatum)')); + $participantTwoBirthDate = trim((string) $xpath->evaluate('string(//teilnehmer[2]/geburtsdatum)')); $this->assertNotSame('Example', $applicantName); $this->assertSame($applicantName, $participantOneName); @@ -76,6 +82,9 @@ XML; $this->assertSame('01000000002', $participantOneMobilePhone); $this->assertSame($applicantMobilePhone, $participantOneMobilePhone); $this->assertNotSame($participantOneName, $participantTwoName); + $this->assertSame('03.04.1991', $applicantBirthDate); + $this->assertSame('03.04.1991', $participantOneBirthDate); + $this->assertSame('12.11.1987', $participantTwoBirthDate); $this->assertSame(3, $anonymizer->getLastIdentityCount()); } @@ -181,7 +190,7 @@ XML; $this->assertSame('Divers', $responseSalutation); $this->assertSame('', $responseTitle); $this->assertSame('D', $responseGender); - $this->assertSame('01.01.1980', $responseBirthDate); + $this->assertSame('16.04.1972', $responseBirthDate); $this->assertSame('XX', $responseNationality); $this->assertNotSame('Beispielweg 57', $responseStreet); $this->assertNotSame('42853', $responsePostalCode); @@ -501,7 +510,7 @@ XML; $this->assertSame('Divers', $salutation); $this->assertSame('', $title); $this->assertSame('D', $gender); - $this->assertSame('01.01.1980', $birthDate); + $this->assertSame('01.02.1990', $birthDate); $this->assertSame('XX', $nationality); $this->assertNotSame('Beispielweg 12', $street); $this->assertNotSame('12345', $postalCode);