This unit test incorrectly fails with the validation error {"errors":{"parameter.0":{"valueBoolean":{"value":{"value":{"pattern":"Field \"value\" on type \"boolean-primitive\" value of \"1\" does not match pattern: /^true|false$/"}}}}}}
<?php
namespace App\Tests;
use DCarbone\PHPFHIRGenerated\R4\PHPFHIRResponseParser;
use PHPUnit\Framework\TestCase;
class BooleanValidationTest extends TestCase
{
public function testBooleanValidation(): void
{
$fhir = <<<FHIR
<?xml version="1.0" encoding="utf-8"?>
<Parameters xmlns="http://hl7.org/fhir">
<meta>
<profile value="https://e-lb.de/fhir/StructureDefinition/KK_ELB_ParticipationStatusResponseParameters"/>
</meta>
<parameter>
<name value="isParticipating"/>
<valueBoolean value="true"/>
</parameter>
</Parameters>
FHIR;
$parser = new PHPFHIRResponseParser();
$fhirResponse = $parser->parseXml($fhir);
$validationErrors = $fhirResponse->_getValidationErrors();
self::assertEquals([], $validationErrors);
}
}
This unit test incorrectly fails with the validation error {"errors":{"parameter.0":{"valueBoolean":{"value":{"value":{"pattern":"Field \"value\" on type \"boolean-primitive\" value of \"1\" does not match pattern: /^true|false$/"}}}}}}