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)); }
public function testEvaluateFalse() { $v = new Alpha(null, null, false); $this->assertFalse($v->evaluate('abcdef')); $this->assertTrue($v->evaluate('123456')); }