You are here

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

File

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

Class

XmlEncoderTest

Namespace

Symfony\Component\Serializer\Tests\Encoder

Code

public function testDecodeIgnoreWhiteSpace() {
  $source = <<<XML
<?xml version="1.0"?>
<people>
    <person>
        <firstname>Benjamin</firstname>
        <lastname>Alexandre</lastname>
    </person>
    <person>
        <firstname>Damien</firstname>
        <lastname>Clay</lastname>
    </person>
</people>
XML;
  $expected = array(
    'person' => array(
      array(
        'firstname' => 'Benjamin',
        'lastname' => 'Alexandre',
      ),
      array(
        'firstname' => 'Damien',
        'lastname' => 'Clay',
      ),
    ),
  );
  $this
    ->assertEquals($expected, $this->encoder
    ->decode($source, 'xml'));
}