/**
  * @param AbstractSpatialType $type
  * @param string              $sqlExpr
  *
  * @return GeometryInterface
  */
 public function convertBinaryToPHPValue(AbstractSpatialType $type, $sqlExpr)
 {
     $parser = new BinaryParser($sqlExpr);
     return $this->newObjectFromValue($type, $parser->parse());
 }
 /**
  * {@inheritdoc}
  */
 public function convertBinaryToPHPValue($sqlExpr)
 {
     $parser = new BinaryParser($sqlExpr);
     return $this->newObjectFromValue($parser->parse());
 }
Exemple #3
0
 public function testReusedParser()
 {
     $parser = new Parser();
     foreach ($this->goodBinaryData() as $testData) {
         $actual = $parser->parse($testData['value']);
         $this->assertEquals($testData['expected'], $actual);
         $actual = $parser->parse('x' . $testData['value']);
         $this->assertEquals($testData['expected'], $actual);
         $actual = $parser->parse('X' . $testData['value']);
         $this->assertEquals($testData['expected'], $actual);
         $actual = $parser->parse('0x' . $testData['value']);
         $this->assertEquals($testData['expected'], $actual);
         $actual = $parser->parse('0X' . $testData['value']);
         $this->assertEquals($testData['expected'], $actual);
         $actual = $parser->parse(pack('H*', $testData['value']));
         $this->assertEquals($testData['expected'], $actual);
     }
 }