You are here

public function XmlEncoderTest::testDecodeScalarRootAttributes in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Tests/Encoder/XmlEncoderTest.php \Symfony\Component\Serializer\Tests\Encoder\XmlEncoderTest::testDecodeScalarRootAttributes()

File

vendor/symfony/serializer/Tests/Encoder/XmlEncoderTest.php, line 304

Class

XmlEncoderTest

Namespace

Symfony\Component\Serializer\Tests\Encoder

Code

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