Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/4117'
Browse files Browse the repository at this point in the history
Close #4117
  • Loading branch information
weierophinney committed Mar 28, 2013
2 parents 44ca4a4 + 349e3d1 commit 9fbd314
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/Zend/InputFilter/Factory.php
Expand Up @@ -153,6 +153,9 @@ public function createInput($inputSpecification)
$input->setRequired(!$value);
}
break;
case 'error_message':
$input->setErrorMessage($value);
break;
case 'fallback_value':
$input->setFallbackValue($value);
break;
Expand Down
10 changes: 10 additions & 0 deletions tests/ZendTest/InputFilter/FactoryTest.php
Expand Up @@ -413,4 +413,14 @@ public function testFactoryAllowsPassingFilterChainsInInputSpec()
$test = $input->getFilterChain();
$this->assertSame($chain, $test);
}

public function testFactoryWillCreateInputWithErrorMessage()
{
$factory = new Factory();
$input = $factory->createInput(array(
'name' => 'foo',
'error_message' => 'My custom error message',
));
$this->assertEquals('My custom error message', $input->getErrorMessage());
}
}

0 comments on commit 9fbd314

Please sign in to comment.