/** * Valida se o número do PIS-PASEP está correto. * @param string|int|\Sped\Commons\Documents\PisPasep $value * @return boolean */ public function validate($value) { if (!$value instanceof \Sped\Commons\Documents\PisPasep) { $value = new \Sped\Commons\Documents\PisPasep($value); } return parent::validate($value); }
/** * Valida se o Chave de Acesso está correta. * @param string|int|\Sped\Commons\Documents\ChaveAcesso $value * @return boolean */ public function validate($value) { if (!$value instanceof \Sped\Commons\Documents\ChaveAcesso) { $value = new \Sped\Commons\Documents\ChaveAcesso($value); } return parent::validate($value); }
public function testCalculateCheckDigit() { $modulo11 = new Modulo11(); $this->assertSame('7', $modulo11->calculateCheckDigit('036532')); $this->assertSame('2', $modulo11->calculateCheckDigit('392844404')); $this->assertSame('9', $modulo11->calculateCheckDigit('013139139')); $this->assertSame('9', $modulo11->calculateCheckDigit('01313913911')); $this->assertSame('X', $modulo11->calculateCheckDigit('007007013')); $this->assertSame('0', $modulo11->calculateCheckDigit('036530')); }