/** * Gets validator rule for specified type (string). * * @param Column $column The column that is being validated. * @param string $type The type (string) for validator (e.g. 'required'). * @param mixed $value The value for the validator (if applicable) */ protected function getValidatorRule(Column $column, $type, $value = null) { $rule = new Rule(); $rule->setName($type); if ($value !== null) { $rule->setValue($value); } $rule->setMessage($this->getRuleMessage($column, $type, $value)); return $rule; }
/** * Test the getter/setter for the name property * * @covers \Psecio\Iniscan\Rule::getName * @covers \Psecio\Iniscan\Rule::setName */ public function testGetSetName() { $name = 'test name'; $rule = new Rule(array(), 'testing123'); $rule->setName($name); $this->assertEquals($rule->getName(), $name); }