postal() public static method

Checks a postal code for France.
public static postal ( string $check ) : boolean
$check string The value to check.
return boolean Success.
Beispiel #1
0
 /**
  * test the postal method of FrValidation
  *
  * @return void
  */
 public function testPostal()
 {
     $this->assertTrue(FrValidation::postal('01001'));
     $this->assertTrue(FrValidation::postal('14000'));
     $this->assertTrue(FrValidation::postal('75001'));
     $this->assertTrue(FrValidation::postal('13200'));
     $this->assertTrue(FrValidation::postal('97500'));
     $this->assertTrue(FrValidation::postal('99138'));
     $this->assertFalse(FrValidation::postal('1400'));
     $this->assertFalse(FrValidation::postal('14 000'));
     $this->assertFalse(FrValidation::postal('00000'));
     $this->assertFalse(FrValidation::postal('01000'));
     $this->assertFalse(FrValidation::postal('99139'));
 }