public function XmlEncoderTest::testDecodeScalarWithAttribute

File

drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php, line 212

Class

XmlEncoderTest

Namespace

Symfony\Component\Serializer\Tests\Encoder

Code

public function testDecodeScalarWithAttribute() {
  $source = '<?xml version="1.0"?>' . "\n" . '<response><person gender="M">Peter</person></response>' . "\n";
  $expected = array(
    'person' => array(
      '@gender' => 'M',
      '#' => 'Peter',
    ),
  );
  $this
    ->assertEquals($expected, $this->encoder
    ->decode($source, 'xml'));
}