cc() public static method

Validation of Iran credit card numbers.
public static cc ( string $check ) : boolean
$check string The value to check.
return boolean Success.
Beispiel #1
0
 /**
  * test the cc method of IrValidation
  *
  * @return void
  */
 public function testCc()
 {
     $this->assertTrue(IrValidation::cc('1111222233334444'));
     $this->assertTrue(IrValidation::cc('1111-2222-3333-4444'));
     $this->assertFalse(IrValidation::cc('teststring'));
     $this->assertFalse(IrValidation::cc('1111'));
     $this->assertFalse(IrValidation::cc('1111 2222 3333 4444'));
     $this->assertFalse(IrValidation::cc('111-122-223-333-444-4'));
 }