Inheritance: extends LocalizedValidation
Example #1
0
 /**
  * test the phone method of EsValidation
  *
  * @return void
  */
 public function testPhone()
 {
     $this->assertTrue(EsValidation::phone('924227227'));
     $this->assertTrue(EsValidation::phone('924.227.227'));
     $this->assertTrue(EsValidation::phone('924-227-227'));
     $this->assertTrue(EsValidation::phone('924-22-72-27'));
     $this->assertTrue(EsValidation::phone('924 22 72 27'));
     $this->assertTrue(EsValidation::phone('924227227'));
     $this->assertTrue(EsValidation::phone('624227227'));
     $this->assertTrue(EsValidation::phone('924-227227'));
     $this->assertTrue(EsValidation::phone('827-227227'));
     $this->assertTrue(EsValidation::phone('91-2227227'));
     $this->assertFalse(EsValidation::phone('127227227'));
     $this->assertFalse(EsValidation::phone('813 4567'));
 }
Example #2
0
 /**
  * Test the nif validation.
  *
  * @return void
  */
 public function testNif()
 {
     $this->assertTrue(EsValidation::nif('K1254868A'));
     $this->assertTrue(EsValidation::nif('K3548762H'));
     $this->assertTrue(EsValidation::nif('L5876542A'));
     $this->assertFalse(EsValidation::nif('X5876542A'));
     $this->assertFalse(EsValidation::nif('Z2548769Y'));
     $this->assertFalse(EsValidation::nif('32050031Z'));
 }