Esempio n. 1
0
 protected function validate()
 {
     $number = $this->format();
     if (Modulus11::calculate(substr($number, 0, 9), [2, 5, 4, 9, 8, 1, 6, 7, 3]) != $number[9]) {
         return false;
     }
     return Modulus11::validate($number);
 }
Esempio n. 2
0
 protected function validate()
 {
     $number = $this->format();
     return Modulus11::validate($number);
 }
Esempio n. 3
0
 public function testCustomFactors()
 {
     $this->assertTrue(Modulus11::validate('11223346'));
     $this->assertTrue(Modulus11::validate('1705833214', [2, 5, 4, 9, 8, 1, 6, 7, 3]));
     $this->assertSame(3, Modulus11::calculate('1705833214'));
 }