8000 Update XmlEncoderTest.php by Youngemmy5956 · Pull Request #52414 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

Update XmlEncoderTest.php #52414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,18 @@ public function testEncodeWithNamespace()

$this->assertEquals($source, $this->encoder->encode($array, 'xml'));
}
public function testParseXmlAttributesWithNamespace()
{
$encoder = new XmlEncoder();

$xml = '<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:ns="http://example.com" ns:attribute="value"></root>';

$data = $encoder->decode($xml, 'xml');

$this->assertEquals(['@xmlns:ns' => 'http://example.com', '@ns:attribute' => 'value'], $data);
}


public function testEncodeSerializerXmlRootNodeNameOption()
{
Expand Down Expand Up @@ -474,6 +486,8 @@ public function testDecodeWithNamespace()
$this->assertEquals($array, $this->encoder->decode($source, 'xml'));
}



public function testDecodeScalarWithAttribute()
{
$source = '<?xml version="1.0"?>'."\n".
Expand Down
0