mobile() public static method

Checks mobile numbers for Iran.
public static mobile ( string $check ) : boolean
$check string The value to check.
return boolean Success.
Example #1
0
 /**
  * test the mobile method of IrValidation
  *
  * @return void
  */
 public function testMobile()
 {
     $this->assertTrue(IrValidation::mobile('989123334444'));
     $this->assertTrue(IrValidation::mobile('00989353334444'));
     $this->assertTrue(IrValidation::mobile('+989363334444'));
     $this->assertTrue(IrValidation::mobile('+98 9373334444'));
     $this->assertTrue(IrValidation::mobile('(+98) 9383334444'));
     $this->assertTrue(IrValidation::mobile('+98-9323334444'));
     $this->assertTrue(IrValidation::mobile('+989203334444'));
     $this->assertFalse(IrValidation::mobile('teststring'));
     $this->assertFalse(IrValidation::mobile('999123334444'));
     $this->assertFalse(IrValidation::mobile('+999353334444'));
     $this->assertFalse(IrValidation::mobile('00999363334444'));
     $this->assertFalse(IrValidation::mobile('000989373334444'));
     $this->assertFalse(IrValidation::mobile('+00989383334444'));
     $this->assertFalse(IrValidation::mobile('+0989323334444'));
 }