public function XmlEncoderTest::testEncodeScalarRootAttributes

File

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

Class

XmlEncoderTest

Namespace

Symfony\Component\Serializer\Tests\Encoder

Code

public function testEncodeScalarRootAttributes() {
  $array = array(
    '#' => 'Paul',
    '@gender' => 'm',
  );
  $expected = '<?xml version="1.0"?>' . "\n" . '<response gender="m">Paul</response>' . "\n";
  $this
    ->assertEquals($expected, $this->encoder
    ->encode($array, 'xml'));
}