public function testUniqueRuleName() { $v = new Validator(array()); $args = array("foo", "bar"); $this->assertEquals("foo_bar_rule", $v->getUniqueRuleName($args)); $this->assertEquals("foo_rule", $v->getUniqueRuleName("foo")); $v->addInstanceRule("foo_rule", function () { }); $u = $v->getUniqueRuleName("foo"); $this->assertRegExp("/^foo_rule_[0-9]{1,5}\$/", $u); }