Автор: Nick Sagona, III (nick@popphp.org)
Наследование: extends Validator
Пример #1
0
 public function testStringRandom()
 {
     $s = String::random(6);
     $this->assertEquals(6, strlen($s));
     $s = String::random(6, String::ALPHANUM, String::LOWER);
     $val = new Validator\AlphaNumeric();
     $this->assertTrue($val->evaluate($s));
     $s = String::random(6, String::ALPHA, String::UPPER);
     $val = new Validator\Alpha();
     $this->assertTrue($val->evaluate($s));
 }
Пример #2
0
 public function testEvaluateFalse()
 {
     $v = new Alpha(null, null, false);
     $this->assertFalse($v->evaluate('abcdef'));
     $this->assertTrue($v->evaluate('123456'));
 }