function testInvalidValueRuleError2() { $rule = new lmbInvalidValueRule('testfield', 1); $data = new lmbSet(); $data->set('testfield', '1'); $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} value is wrong', 'validation'), array('Field' => 'testfield'), array())); $rule->validate($data, $this->error_list); }
function testInvalidValueRule_Success_Array() { $rule = new lmbInvalidValueRule('testfield', array('foo', 'bar')); $data = new lmbSet(); $data->set('testfield', 'baz'); $this->error_list->expectNever('addError'); $rule->validate($data, $this->error_list); }