public function testRemainingPlaces() { $one = new Place("Imperia", new Point(43.889686, 8.039517)); $two = new Place("Sanremo", new Point(43.815967, 7.776057)); $three = new Place("Ventimiglia", new Point(43.791237, 7.607586)); $roadmap = new Roadmap([$one, $two, $three]); $this->assertContains($one, $roadmap->getRemainingPlaces()); $roadmap->addPlace($one); $this->assertNotContains($one, $roadmap->getRemainingPlaces()); }
public function testGetDistance() { $roadmap = new Roadmap([new Place("Imperia", new Point(43.889686, 8.039517)), new Place("Sanremo", new Point(43.815967, 7.776057)), new Place("Ventimiglia", new Point(43.791237, 7.607586))]); $this->assertEquals(36.45, $roadmap->distance(), "wrong distance", 0.01); }