Esempio n. 1
0
 /**
  * CCValidator::numeric tests
  */
 public function test_numeric()
 {
     $validator = new CCValidator(array('1' => '123', '2' => 1242, '3' => '123.34', '4' => '1nope23', '5' => '122,0', '6' => '12+2'));
     $this->assertTrue($validator->numeric('1'));
     $this->assertFalse($validator->not_numeric('1'));
     $this->assertTrue($validator->numeric('2'));
     $this->assertTrue($validator->numeric('3'));
     $this->assertFalse($validator->numeric('4'));
     $this->assertFalse($validator->numeric('5'));
     $this->assertFalse($validator->numeric('6'));
 }