/** * The number must be in the format <b>XXXXXX-XXX(D)</b> or * <b>XXXXXX - XXX(D)</b> or any permutations of those two. If the * checkdigit (D) is not supplied, it will be calculated * * @param string|int $number The personnumer or organizational number * @param bool $withCheckDigit [Defaults to true] <br> Is the check digit * included in $number? * @throws InvalidArgumentException */ public function setNumber($number, $withCheckDigit = true) { if (!static::isValid($number)) { throw new \InvalidArgumentException("{$number} is not a valid personnummer"); } parent::setNumber($number, $withCheckDigit); }
/** * @covers LuhnAlgorithm::setNumber */ public function testSetNumber() { $this->object->setNumber("410321-9202"); }