public function XmlEncoderTest::testDecodeArray 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::testDecodeArray()
File
- vendor/
symfony/ serializer/ Tests/ Encoder/ XmlEncoderTest.php, line 331
Class
Namespace
Symfony\Component\Serializer\Tests\EncoderCode
public function testDecodeArray() {
$source = '<?xml version="1.0"?>' . "\n" . '<response>' . '<people>' . '<person><firstname>Benjamin</firstname><lastname>Alexandre</lastname></person>' . '<person><firstname>Damien</firstname><lastname>Clay</lastname></person>' . '</people>' . '</response>' . "\n";
$expected = array(
'people' => array(
'person' => array(
array(
'firstname' => 'Benjamin',
'lastname' => 'Alexandre',
),
array(
'firstname' => 'Damien',
'lastname' => 'Clay',
),
),
),
);
$this
->assertEquals($expected, $this->encoder
->decode($source, 'xml'));
}