Skip to content

Commit 01018f2

Browse files
committed
test creating empty geometry collection from wkt
1 parent 102db62 commit 01018f2

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

tests/Objects/GeometryCollectionTest.php

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,17 @@
397397
expect($geometryCollectionFromWkt)->toEqual($geometryCollection);
398398
});
399399

400+
it('creates empty geometry collection from WKT', function (): void {
401+
// Arrange
402+
$geometryCollection = new GeometryCollection([]);
403+
404+
// Act
405+
$geometryCollectionFromWkt = GeometryCollection::fromWkt('GEOMETRYCOLLECTION EMPTY');
406+
407+
// Assert
408+
expect($geometryCollectionFromWkt)->toEqual($geometryCollection);
409+
});
410+
400411
it('generates geometry collection WKT', function (): void {
401412
$geometryCollection = new GeometryCollection([
402413
new Polygon([
@@ -417,6 +428,17 @@
417428
expect($wkt)->toBe($expectedWkt);
418429
});
419430

431+
it('generates empty geometry collection WKT', function (): void {
432+
// Arrange
433+
$geometryCollection = new GeometryCollection([]);
434+
435+
// Act
436+
$wkt = $geometryCollection->toWkt();
437+
438+
// Assert
439+
expect($wkt)->toBe('GEOMETRYCOLLECTION EMPTY');
440+
});
441+
420442
it('creates geometry collection from WKB', function (): void {
421443
$geometryCollection = new GeometryCollection([
422444
new Polygon([
@@ -670,8 +692,3 @@
670692
})->toThrow(InvalidArgumentException::class);
671693
});
672694

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

Comments
 (0)