public function XmlEncoderTest::testDecodeRootAttributes in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/serializer/Tests/Encoder/XmlEncoderTest.php \Symfony\Component\Serializer\Tests\Encoder\XmlEncoderTest::testDecodeRootAttributes()
File
- vendor/
symfony/ serializer/ Tests/ Encoder/ XmlEncoderTest.php, line 317
Class
Namespace
Symfony\Component\Serializer\Tests\EncoderCode
public function testDecodeRootAttributes() {
$source = '<?xml version="1.0"?>' . "\n" . '<person gender="M"><firstname>Peter</firstname><lastname>Mac Calloway</lastname></person>' . "\n";
$expected = array(
'firstname' => 'Peter',
'lastname' => 'Mac Calloway',
'@gender' => 'M',
);
$this
->assertEquals($expected, $this->encoder
->decode($source, 'xml'));
}