Beispiel #1
0
 public function testNumbers()
 {
     $result = SimpleValidator::numbers("546");
     $this->assertEquals(true, $result);
     $result = SimpleValidator::numbers("5x6");
     $this->assertEquals(false, $result);
     $result = SimpleValidator::numbers("z46");
     $this->assertEquals(false, $result);
     $result = SimpleValidator::numbers("54c");
     $this->assertEquals(false, $result);
     $result = SimpleValidator::numbers("sss");
     $this->assertEquals(false, $result);
     $result = SimpleValidator::numbers("3,111,000");
     $this->assertEquals(true, $result);
     $result = SimpleValidator::numbers("3,029,000,");
     $this->assertEquals(false, $result);
 }