public function setValue($value) { if (!is_integer($value)) { throw new InvalidArgumentException('Integer required'); } if ($this->minRange > $value || $this->maxRange < $value) { throw new InvalidArgumentException('Invalid Value'); } parent::setValue($value); }
public function testAddIntegerType() { $option = new IntegerOption(); $option->setValue(123); $type = new OptionType(); $this->invokeMethod($type, 'addIntegerType', [$this->formBuilder(), 'key', $option]); }