Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fed5e4a

Browse filesBrowse files
committed
Add tests for DOMNode case
1 parent 141d9ee commit fed5e4a
Copy full SHA for fed5e4a

File tree

1 file changed

+14
-0
lines changed
Filter options

1 file changed

+14
-0
lines changed

‎src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,20 @@ public function testEncodeXmlWithBoolValue()
662662
$this->assertEquals($expectedXml, $actualXml);
663663
}
664664

665+
public function testEncodeXmlWithDomNodeValue()
666+
{
667+
$expectedXml = <<<'XML'
668+
<?xml version="1.0"?>
669+
<response><foo>bar</foo><bar>foo &amp; 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+
665679
public function testEncodeXmlWithDateTimeObjectValue()
666680
{
667681
$xmlEncoder = $this->createXmlEncoderWithDateTimeNormalizer();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.