public function XmlEncoderTest::testEncodeRootAttributes 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::testEncodeRootAttributes()
File
- vendor/
symfony/ serializer/ Tests/ Encoder/ XmlEncoderTest.php, line 173
Class
Namespace
Symfony\Component\Serializer\Tests\EncoderCode
public function testEncodeRootAttributes() {
$array = array(
'firstname' => 'Paul',
'@gender' => 'm',
);
$expected = '<?xml version="1.0"?>' . "\n" . '<response gender="m"><firstname>Paul</firstname></response>' . "\n";
$this
->assertEquals($expected, $this->encoder
->encode($array, 'xml'));
}