private function expectDrawLine($gc, $color, Point $startPoint, Point $endPoint) { $gc->expects($this->once())->method('setLineColor')->id('color')->with($color); $gc->expects($this->once())->method('setLineWidth')->id('line')->with(0.5); $gc->expects($this->once())->after('color')->method('drawLine')->with($startPoint->getX(), $startPoint->getY(), $endPoint->getX(), $endPoint->getY()); }
private function getPointBetween(Point $point1, Point $point2) { $x = $point1->getX() + ($point2->getX() - $point1->getX()) / 2; $y = $point2->getY() + ($point1->getY() - $point2->getY()) / 2; return Point::getInstance($x, $y); }