We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 567434b commit 102db62Copy full SHA for 102db62
src/Objects/GeometryCollection.php
@@ -42,6 +42,10 @@ public function toWkt(): string
42
{
43
$wktData = $this->getWktData();
44
45
+ if ($wktData === '') {
46
+ return 'GEOMETRYCOLLECTION EMPTY';
47
+ }
48
+
49
return "GEOMETRYCOLLECTION({$wktData})";
50
}
51
tests/Objects/GeometryCollectionTest.php
@@ -669,3 +669,9 @@
669
TestPlace::factory()->create(['geometry_collection' => $geometryCollection]);
670
})->toThrow(InvalidArgumentException::class);
671
});
672
673
+it('generates empty geometry collection WKT', function (): void {
674
+ $geometryCollection = new GeometryCollection([]);
675
676
+ expect($geometryCollection->toWkt())->toBe('GEOMETRYCOLLECTION EMPTY');
677
+});
0 commit comments