Ejemplo n.º 1
0
 public function testReusedParser()
 {
     $parser = new Parser();
     foreach ($this->parserTestData() as $name => $testData) {
         $value = $testData['value'];
         $expected = $testData['expected'];
         if ($expected instanceof ExceptionInterface) {
             $this->setExpectedException(get_class($expected), $expected->getMessage());
         }
         $actual = $parser->parse($value);
         $this->assertEquals($expected, $actual, 'Failed dataset "' . $name . '"');
     }
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function convertStringToPHPValue($sqlExpr)
 {
     $parser = new StringParser($sqlExpr);
     return $this->newObjectFromValue($parser->parse());
 }
 /**
  * @param AbstractSpatialType $type
  * @param string              $sqlExpr
  *
  * @return GeometryInterface
  */
 public function convertStringToPHPValue(AbstractSpatialType $type, $sqlExpr)
 {
     $parser = new StringParser($sqlExpr);
     return $this->newObjectFromValue($type, $parser->parse());
 }