diff --git a/src/XMLHelper/MindboxXMLSerializer.php b/src/XMLHelper/MindboxXMLSerializer.php index 735fc37..210d27e 100644 --- a/src/XMLHelper/MindboxXMLSerializer.php +++ b/src/XMLHelper/MindboxXMLSerializer.php @@ -47,6 +47,8 @@ private static function getXML(&$xml, array $data) if (is_array($value)) { $subNode = $xml->addChild($key); self::getXML($subNode, $value); + } elseif (is_bool($value)) { + $xml->addChild($key, var_export($value, true)); } else { $xml->addChild($key, $value); } diff --git a/tests/DTO/DTOTest.php b/tests/DTO/DTOTest.php index 13e4f2e..df84d13 100644 --- a/tests/DTO/DTOTest.php +++ b/tests/DTO/DTOTest.php @@ -184,13 +184,13 @@ public function asXmlFieldsProvider() 'someDtoField' => $this->getDto(['dto' => 'value']), ], ' -<' . $this->getXmlName() . '>Andrew331valuevaluegetXmlName() . '> +<' . $this->getXmlName() . '>Andrew33truevaluevaluegetXmlName() . '> ', ], [ ['name' => 'Andrew', 'age' => 33, 'someField' => true, 33 => '345'], ' -<' . $this->getXmlName() . '>Andrew331345getXmlName() . '> +<' . $this->getXmlName() . '>Andrew33true345getXmlName() . '> ', ], [