Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'hotfix/4838' into develop

Forward port #4838
  • Loading branch information...
commit 5dbd8aa7f7c019944f81d4fb5d27322a9c0c07d2 2 parents a0baba2 + 4c8623a
Matthew Weier O'Phinney weierophinney authored
1  library/Zend/InputFilter/Factory.php
View
@@ -212,6 +212,7 @@ public function createInput($inputSpecification)
break;
case 'error_message':
$input->setErrorMessage($value);
+ break;
case 'fallback_value':
$input->setFallbackValue($value);
break;
15 tests/ZendTest/InputFilter/FactoryTest.php
View
@@ -520,11 +520,24 @@ public function testConflictNameWithInputFilterType()
public function testCustomFactoryInCollection()
{
$factory = new CustomFactory();
- /** @var \Zend\InputFilter\CollectionInputFilter $inputFilter */
$inputFilter = $factory->createInputFilter(array(
'type' => 'collection',
'input_filter' => new InputFilter(),
));
$this->assertInstanceOf('ZendTest\InputFilter\TestAsset\CustomFactory', $inputFilter->getFactory());
}
+
+ /**
+ * @group 4838
+ */
+ public function testCanSetInputErrorMessage()
+ {
+ $factory = new Factory();
+ $input = $factory->createInput(array(
+ 'name' => 'test',
+ 'type' => 'Zend\InputFilter\Input',
+ 'error_message' => 'Custom error message',
+ ));
+ $this->assertEquals('Custom error message', $input->getErrorMessage());
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.