Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 /**
  * @covers LuhnAlgorithm::setNumber
  */
 public function testSetNumber()
 {
     $this->object->setNumber("410321-9202");
 }