Пример #1
0
 /**
  * @dataProvider providerGeometryN
  *
  * @param string      $geometry  The WKT of the GeometryCollection to test.
  * @param integer     $n         The number of the geometry to return.
  * @param string|null $geometryN The WKT of the expected result, or NULL if an exception is expected.
  * @param integer     $srid      The SRID of the geometries.
  */
 public function testGeometryN($geometry, $n, $geometryN, $srid)
 {
     if ($geometryN === null) {
         $this->setExpectedException(NoSuchGeometryException::class);
     }
     $g = GeometryCollection::fromText($geometry, $srid);
     $this->assertWktEquals($g->geometryN($n), $geometryN, $srid);
 }
Пример #2
0
 /**
  * @dataProvider providerWriteEmptyGeometryCollection
  *
  * @param string $wkt The WKT to test.
  */
 public function testWriteEmptyGeometryCollection($wkt)
 {
     $writer = new WKTWriter();
     $geometry = GeometryCollection::fromText($wkt);
     $this->assertSame($wkt, $writer->write($geometry));
 }