/** * @group testByPoint */ public function testByPoint() { $whathoodUser = $this->getSavedUser(); // create a neighborhood and save it $neighborhoodPolygon = DummyEntityBuilder::neighborhoodPolygon($whathoodUser); $polygon = new Polygon(array(array(new Point(0, 0), new Point(10, 0), new Point(10, 10), new Point(0, 10), new Point(0, 0)))); $neighborhoodPolygon->setPolygon($polygon); $testPoint = new Point(5, 5); $this->object->save($neighborhoodPolygon); $neighborhoods = $this->object->byPoint($testPoint); $this->assertTrue(count($neighborhoods) === 1); }
public function getSavedNeighborhoodPolygon($userName, $PolygonName) { $whathoodUser = $this->getSavedUser($userName); $neighborhoodPolygon = DummyEntityBuilder::neighborhoodPolygon($whathoodUser); $this->neighborhoodPolygonMapper()->save($neighborhoodPolygon); return $neighborhoodPolygon; }