Skip to content

Commit

Permalink
Fixed Point::envelope() tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Mar 20, 2015
1 parent b285978 commit c1484fb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/PointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,15 @@ public function testEnvelope(Point $point)
$this->is3D($point->is3D());
$this->isMeasured($point->isMeasured());

$envelope = $point->envelope()->asText();
$envelope = $point->envelope();
$possiblePoint = $point->noZ()->noM();
$possiblePolygon = Polygon::factory([LinearRing::factory(array_fill(0, 5, $possiblePoint))]);

$polygon = Polygon::factory([LinearRing::factory([$point, $point, $point, $point, $point])]);
$this->assertTrue($envelope == $point->asText() || $envelope == $polygon->asText(), $envelope);
$envelope = $envelope->asText();
$possiblePoint = $possiblePoint->asText();
$possiblePolygon = $possiblePolygon->asText();

$this->assertTrue($envelope == $possiblePoint || $envelope == $possiblePolygon, 'Unexpected envelope: ' . $envelope);
}

/**
Expand Down

0 comments on commit c1484fb

Please sign in to comment.