Skip to content

Commit

Permalink
Fixed Point::envelope() test for other engines than MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Mar 20, 2015
1 parent b253d39 commit 34ba12b
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions tests/PointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
namespace Brick\Geo\Tests;

use Brick\Geo\Geometry;
use Brick\Geo\LinearRing;
use Brick\Geo\Point;
use Brick\Geo\Polygon;

/**
* Unit tests for class Point.
Expand Down Expand Up @@ -205,9 +207,26 @@ public function providerEquals()
];
}

public function testEnvelope()
/**
* @dataProvider providerEnvelope
*
* @param Point $point
*/
public function testEnvelope(Point $point)
{
$this->assertTrue($point->envelope()->equals($point));
}

/**
* @return array
*/
public function providerEnvelope()
{
$envelope = Point::xy(1, 2)->envelope();
$this->assertSame('POLYGON ((1 2, 1 2, 1 2, 1 2, 1 2))', $envelope->asText());
return [
[Point::xy(1, 2)],
[Point::xyz(2, 3, 4)],
[Point::xym(3, 4, 5)],
[Point::xyzm(4, 5, 6, 7)]
];
}
}

0 comments on commit 34ba12b

Please sign in to comment.