Esempio n. 1
0
 function testUInt()
 {
     $v = new Valid_UInt();
     $v->disableFeedback();
     $this->assertTrue($v->validate('0'));
     $this->assertTrue($v->validate('1'));
     $this->assertTrue($v->validate('2147483647'));
     $this->assertFalse($v->validate('-1'));
     // With a value lower than -2^31 it may imply a int overflow that may
     // generate a positive int (in this case: 2^31-1).
     $this->assertFalse($v->validate('-2147483649'));
     $this->assertFalse($v->validate('0.5'));
     $this->assertFalse($v->validate('toto'));
 }