/** * @expectedException InvalidArgumentException */ public function testSetInvalidElement() { // Arrange $vector = new Vector2(0, 0); // Act $vector->setElement(123, 0); // Assert // ... }
/** * Initializes a new instance of this class. * * @param float $x The X-component to set. * @param float $y The Y-component to set. * @param float $z The Z-component to set. */ public function __construct($x, $y, $z) { parent::__construct($x, $y); $this->setZ($z); }