public function XmlEncoderTest::testSetRootNodeName

File

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

Class

XmlEncoderTest

Namespace

Symfony\Component\Serializer\Tests\Encoder

Code

public function testSetRootNodeName() {
  $obj = new ScalarDummy();
  $obj->xmlFoo = "foo";
  $this->encoder
    ->setRootNodeName('test');
  $expected = '<?xml version="1.0"?>' . "\n" . '<test>foo</test>' . "\n";
  $this
    ->assertEquals($expected, $this->encoder
    ->encode($obj, 'xml'));
}