Skip to content

Commit

Permalink
Merge branch 'feature/zendframework#5691-break_chain_on_failure-input…
Browse files Browse the repository at this point in the history
…filter'

Close zendframework#5691
  • Loading branch information
Ocramius committed Mar 4, 2014
2 parents ef6d51a + 6e3ad52 commit 6a56c29
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/Zend/InputFilter/Factory.php
Expand Up @@ -225,6 +225,9 @@ public function createInput($inputSpecification)
case 'fallback_value':
$input->setFallbackValue($value);
break;
case 'break_on_failure':
$input->setBreakOnFailure($value);
break;
case 'filters':
if ($value instanceof FilterChain) {
$input->setFilterChain($value);
Expand Down
14 changes: 14 additions & 0 deletions tests/ZendTest/InputFilter/FactoryTest.php
Expand Up @@ -567,4 +567,18 @@ public function testSetInputFilterManagerWithoutServiceManager()
$factory->setInputFilterManager($inputFilterManager);
$this->assertSame($inputFilterManager, $factory->getInputFilterManager());
}

/**
* @group 5691
*
* @covers \Zend\InputFilter\Factory::createInput
*/
public function testSetsBreakChainOnFailure()
{
$factory = new Factory();

$this->assertTrue($factory->createInput(array('break_on_failure' => true))->breakOnFailure());

$this->assertFalse($factory->createInput(array('break_on_failure' => false))->breakOnFailure());
}
}

0 comments on commit 6a56c29

Please sign in to comment.