File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/Symfony/Component/Serializer/Tests/Encoder Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -662,6 +662,20 @@ public function testEncodeXmlWithBoolValue()
662
662
$ this ->assertEquals ($ expectedXml , $ actualXml );
663
663
}
664
664
665
+ public function testEncodeXmlWithDomNodeValue ()
666
+ {
667
+ $ expectedXml = <<<'XML'
668
+ <?xml version="1.0"?>
669
+ <response><foo>bar</foo><bar>foo & bar</bar></response>
670
+
671
+ XML;
672
+ $ document = new \DOMDocument ();
673
+
674
+ $ actualXml = $ this ->encoder ->encode (['foo ' => $ document ->createTextNode ('bar ' ), 'bar ' => $ document ->createTextNode ('foo & bar ' )], 'xml ' );
675
+
676
+ $ this ->assertEquals ($ expectedXml , $ actualXml );
677
+ }
678
+
665
679
public function testEncodeXmlWithDateTimeObjectValue ()
666
680
{
667
681
$ xmlEncoder = $ this ->createXmlEncoderWithDateTimeNormalizer ();
You can’t perform that action at this time.
0 commit comments