phone() public static method

Checks a phone number for France.
public static phone ( string $check ) : boolean
$check string The value to check.
return boolean Success.
Beispiel #1
0
 /**
  * test the phone method of FrValidation
  *
  * @return void
  */
 public function testPhone()
 {
     $this->assertTrue(FrValidation::phone('04 76 96 12 32'));
     $this->assertTrue(FrValidation::phone('07-76-96-12-32'));
     $this->assertTrue(FrValidation::phone('08.76.96.12.32'));
     $this->assertTrue(FrValidation::phone('0876961232'));
     $this->assertTrue(FrValidation::phone('09 76 96 12 32'));
     $this->assertFalse(FrValidation::phone('04 76 96 12 3'));
     $this->assertFalse(FrValidation::phone('04 76 96 12 33 '));
     $this->assertFalse(FrValidation::phone('047696123323'));
     $this->assertFalse(FrValidation::phone('07 43 90 33'));
 }