/**
  * @dataProvider samples
  */
 public function testSamples($xml)
 {
     $encoder = new Encoder();
     $decoder = new Decoder();
     $binary = $encoder->encode($xml);
     $actual = $decoder->decode($binary);
     $this->assertEquals($xml, $actual);
 }
예제 #2
0
 public static function decode($content, $indent = false)
 {
     $decoder = new Decoder(array('indent' => $indent, 'dictionary' => 'str%d'));
     return $decoder->decode($content);
 }
 /**
  * @dataProvider samples
  */
 public function testSamples($hexcodes, $expected)
 {
     $binary = $this->convertToBinary($hexcodes);
     $decoder = new Decoder(array('dictionary' => 'str%d'));
     $actual = $decoder->decode($binary);
     $this->assertEquals($expected, $actual);
 }