/** * @covers GeomPoint::toWKT * @expectedException IllegalArgumentException * @expectedExceptionMessage Invalid POINT format: POINT(30.22-122.3340921148) */ public function testToWKTException() { $point = \GeomPoint::fromWKT("POINT(30.22-122.3340921148)"); }
/** * @covers ResultSet::getPoint */ public function testGetPoint() { $pointKey = 'point'; $geoPoint = 'POINT(-122.3340921148 38.421022632969)'; $this->result->setString($pointKey, $geoPoint); $actual = $this->result->getPoint($pointKey)->toWKT(); $excepted = \GeomPoint::fromWKT($geoPoint)->toWKT(); $this->assertSame($actual, $excepted); }
/** * Return a GeomPoint representing the value associated with the given key. * The value associated with the key is assumed to be a string in WKT format. * * @param $key * @return GeomPoint or null if the value associated with the given key is null. */ public function getPoint($key) { $val = $this->map[$key]; return $val === null ? null : GeomPoint::fromWKT($val); }