validate() public static method

SIRET validator.
Author: ronan.guilloux
public static validate ( string $insee, integer $length = 14 ) : boolean
$insee string
$length integer
return boolean
Example #1
0
 /**
  * covers Isocodes::getSiret
  */
 public function testGetSiretWithBlanks()
 {
     $siret = Isocodes::getSiret(true);
     // blanks are not exepcted by validator...
     $this->assertFalse( Siret::validate( $siret ));
     // ... but:
     $this->assertTrue( Siret::validate( str_replace(' ', '', $siret) ));
 }
Example #2
0
 /**
  * testInvalidSiret
  *
  * @param mixed $siret
  *
  * @dataProvider getInvalidSirets
  *
  * return void
  */
 public function testInvalidSiret($siret)
 {
     $this->assertFalse(Siret::validate($siret));
 }