10000 Fix decoding attribute that contains many digits by vlastv · Pull Request #22331 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add test
  • Loading branch information
vlastv authored Apr 7, 2017
commit ed6c2c23522a43a65eda5a6b2eeafcf75f7f544b
13 changes: 13 additions & 0 deletions src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,19 @@ public function testDecodeWithoutItemHash()
$xml = $this->encoder->encode($obj, 'xml');
$this->assertEquals($expected, $this->encoder->decode($xml, 'xml'));
}

public function testDecodeBigDigitAttributes()
{
$source = '<?xml version="1.0"?>'."\n".
'<document index="182077241760011681341821060401202210011000045913000000017100">Name</document>'."\n";

$expected = array(
'#' => 'Name',
'@index' => '182077241760011681341821060401202210011000045913000000017100',
);

$this->assertEquals($expected, $this->encoder->decode($source, 'xml'));
}

/**
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
Expand Down
0