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

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion test/BaseInputFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function testCanRetrieveInvalidInputsOnFailedValidation()
$this->assertArrayNotHasKey('foo', $invalidInputs);
$this->assertArrayHasKey('bar', $invalidInputs);
$this->assertInstanceOf('Zend\InputFilter\Input', $invalidInputs['bar']);
$this->assertArrayHasKey('nest', $invalidInputs, var_export($invalidInputs, 1));
$this->assertArrayHasKey('nest', $invalidInputs/*, var_export($invalidInputs, 1)*/);
$this->assertInstanceOf('Zend\InputFilter\InputFilterInterface', $invalidInputs['nest']);
$nestInvalids = $invalidInputs['nest']->getInvalidInput();
$this->assertArrayHasKey('foo', $nestInvalids);
Expand Down
38 changes: 19 additions & 19 deletions test/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use Zend\InputFilter\Factory;
use Zend\InputFilter\Input;
use Zend\InputFilter\InputFilter;
use Zend\Loader\PluginBroker;
use Zend\Validator;

class FactoryTest extends TestCase
Expand Down Expand Up @@ -61,44 +60,45 @@ public function testFactoryAllowsInjectingValidatorChain()

public function testFactoryUsesComposedFilterChainWhenCreatingNewInputObjects()
{
$factory = new Factory();
$filterChain = new Filter\FilterChain();
$broker = new PluginBroker;
$filterChain->setBroker($broker);
$factory = new Factory();
$filterChain = new Filter\FilterChain();
$pluginManager = new Filter\FilterPluginManager();
$filterChain->setPluginManager($pluginManager);
$factory->setDefaultFilterChain($filterChain);
$input = $factory->createInput(array(
'name' => 'foo',
));
$this->assertInstanceOf('Zend\InputFilter\InputInterface', $input);
$inputFilterChain = $input->getFilterChain();
$this->assertNotSame($filterChain, $inputFilterChain);
$this->assertSame($broker, $inputFilterChain->getBroker());
$this->assertSame($pluginManager, $inputFilterChain->getPluginManager());
}

public function testFactoryUsesComposedValidatorChainWhenCreatingNewInputObjects()
{
$factory = new Factory();
$validatorChain = new Validator\ValidatorChain();
$broker = new PluginBroker;
$validatorChain->setBroker($broker);
$factory = new Factory();
$validatorChain = new Validator\ValidatorChain();
$validatorPlugins = new Validator\ValidatorPluginManager();
$validatorChain->setPluginManager($validatorPlugins);
$factory->setDefaultValidatorChain($validatorChain);
$input = $factory->createInput(array(
'name' => 'foo',
));
$this->assertInstanceOf('Zend\InputFilter\InputInterface', $input);
$inputValidatorChain = $input->getValidatorChain();
$this->assertNotSame($validatorChain, $inputValidatorChain);
$this->assertSame($broker, $inputValidatorChain->getBroker());
$this->assertSame($validatorPlugins, $inputValidatorChain->getPluginManager());
}

public function testFactoryInjectsComposedFilterAndValidatorChainsIntoInputObjectsWhenCreatingNewInputFilterObjects()
{
$factory = new Factory();
$broker = new PluginBroker;
$filterChain = new Filter\FilterChain();
$validatorChain = new Validator\ValidatorChain();
$filterChain->setBroker($broker);
$validatorChain->setBroker($broker);
$factory = new Factory();
$filterPlugins = new Filter\FilterPluginManager();
$validatorPlugins = new Validator\ValidatorPluginManager();
$filterChain = new Filter\FilterChain();
$validatorChain = new Validator\ValidatorChain();
$filterChain->setPluginManager($filterPlugins);
$validatorChain->setPluginManager($validatorPlugins);
$factory->setDefaultFilterChain($filterChain);
$factory->setDefaultValidatorChain($validatorChain);

Expand All @@ -113,8 +113,8 @@ public function testFactoryInjectsComposedFilterAndValidatorChainsIntoInputObjec
$this->assertInstanceOf('Zend\InputFilter\InputInterface', $input);
$inputFilterChain = $input->getFilterChain();
$inputValidatorChain = $input->getValidatorChain();
$this->assertSame($broker, $inputFilterChain->getBroker());
$this->assertSame($broker, $inputValidatorChain->getBroker());
$this->assertSame($filterPlugins, $inputFilterChain->getPluginManager());
$this->assertSame($validatorPlugins, $inputValidatorChain->getPluginManager());
}

public function testFactoryWillCreateInputWithSuggestedFilters()
Expand Down

0 comments on commit 8ca3b51

Please sign in to comment.