postal() public static method

Checks a postal code for Portugal.
public static postal ( string $check ) : boolean
$check string The value to check.
return boolean Success.
Beispiel #1
0
 /**
  * test the postal method of PtValidation
  *
  * @return void
  */
 public function testPostal()
 {
     $this->assertFalse(PtValidation::postal('111'));
     $this->assertFalse(PtValidation::postal('1111'));
     $this->assertFalse(PtValidation::postal('130896'));
     $this->assertFalse(PtValidation::postal('13089-33333'));
     $this->assertFalse(PtValidation::postal('1000 333'));
     $this->assertFalse(PtValidation::postal('0000 333'));
     $this->assertFalse(PtValidation::postal('13A89-4333'));
     $this->assertTrue(PtValidation::postal('1389-333'));
 }