/**
  * @dataProvider samples
  */
 public function testSamples($xml, $expectedHex)
 {
     $expectedHex = strtoupper(preg_replace('/\\s+/', '', $expectedHex));
     $encoder = new Encoder(array('dictionary' => array('dict0', 'dict1', 'dict2', 'http://dict3')));
     $actual = $encoder->encode($xml);
     $actualHex = strtoupper(bin2hex($actual));
     $this->assertEquals($expectedHex, $actualHex);
 }
 /**
  * @dataProvider samples
  */
 public function testSamples($xml)
 {
     $encoder = new Encoder();
     $decoder = new Decoder();
     $binary = $encoder->encode($xml);
     $actual = $decoder->decode($binary);
     $this->assertEquals($xml, $actual);
 }
예제 #3
0
 public static function encode($content)
 {
     $encoder = new Encoder();
     return $encoder->encode($content);
 }