public function testLocation() { $c = new Coordinate(); $newLocation = new Coordinate(50, 50); $c->setLocation($newLocation); $getNewLocation = $c->getLocation(); // new coordinate object $this->assertNotSame($getNewLocation, $newLocation); $this->assertTrue($getNewLocation->equals($newLocation)); }
/** * {@inheritdoc} */ public function getColorAt(Coordinate $coordinate) { $this->assertEmpty(); $x = $coordinate->getX(); $y = $coordinate->getY(); if ($x < 0 || $x > $this->getWidth() || ($y < 0 || $y > $this->getHeight())) { throw new InvalidCoordinateException(sprintf('OutOfBounds - Invalid Coordinate "%s"', (string) $coordinate)); } return @imagecolorat($this->getHandler(), $x, $y); }