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