mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-30 23:01:52 +00:00
Added test for prepending field labels
This commit is contained in:
parent
bfa24585de
commit
9f29a1b99a
@ -12,6 +12,19 @@ class ErrorMessagesTest extends BaseTestCase
|
||||
$this->assertSame(array("Name is required"), $v->errors('name'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the disabling of prepending the field labels
|
||||
* to error messages.
|
||||
*/
|
||||
public function testErrorMessageExcludeFieldName()
|
||||
{
|
||||
$v = new Validator(array());
|
||||
$v->setPrependLabels(false);
|
||||
$v->rule('required', 'name');
|
||||
$v->validate();
|
||||
$this->assertSame(array("is required"), $v->errors('name'));
|
||||
}
|
||||
|
||||
public function testAccurateErrorMessageParams()
|
||||
{
|
||||
$v = new Validator(array('num' => 5));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user