You are here

public function XmlEncoderTest::testElementNameValid 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::testElementNameValid()

File

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

Class

XmlEncoderTest

Namespace

Symfony\Component\Serializer\Tests\Encoder

Code

public function testElementNameValid() {
  $obj = new ScalarDummy();
  $obj->xmlFoo = array(
    'foo-bar' => 'a',
    'foo_bar' => 'a',
    'föo_bär' => 'a',
  );
  $expected = '<?xml version="1.0"?>' . "\n" . '<response>' . '<foo-bar>a</foo-bar>' . '<foo_bar>a</foo_bar>' . '<föo_bär>a</föo_bär>' . '</response>' . "\n";
  $this
    ->assertEquals($expected, $this->encoder
    ->encode($obj, 'xml'));
}