Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,20 @@ public function testCreateInputFilterUsesConfiguredNameForNestedInputFilters()
$this->assertTrue($collectionInputFilter->has('bat'));
}

public function testClearDefaultFilterChain()
{
$factory = $this->createDefaultFactory();
$factory->clearDefaultFilterChain();
$this->assertNull($factory->getDefaultFilterChain());
}

public function testClearDefaultValidatorChain()
{
$factory = $this->createDefaultFactory();
$factory->clearDefaultValidatorChain();
$this->assertNull($factory->getDefaultValidatorChain());
}

/**
* @return Factory
*/
Expand Down
23 changes: 17 additions & 6 deletions test/InputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,20 @@ public function testSetFallbackValue($fallbackValue)
$this->assertSame($input, $return, 'setFallbackValue() must return it self');

$this->assertEquals($fallbackValue, $input->getFallbackValue(), 'getFallbackValue() value not match');
$this->assertEquals(true, $input->hasFallback(), 'hasFallback() value not match');
$this->assertTrue($input->hasFallback(), 'hasFallback() value not match');
}

/**
* @dataProvider setValueProvider
*/
public function testClearFallbackValue($fallbackValue)
{
$input = $this->input;
$input->setFallbackValue($fallbackValue);
$input->clearFallbackValue();
$this->assertNull($input->getFallbackValue(), 'getFallbackValue() value not match');
$this->assertFalse($input->hasFallback(), 'hasFallback() value not match');
}
/**
* @dataProvider fallbackValueVsIsValidProvider
*/
Expand Down Expand Up @@ -541,8 +552,8 @@ public function testMerge()

$this->assertEquals('bazInput', $target->getName(), 'getName() value not match');
$this->assertEquals('bazErrorMessage', $target->getErrorMessage(), 'getErrorMessage() value not match');
$this->assertEquals(true, $target->breakOnFailure(), 'breakOnFailure() value not match');
$this->assertEquals(true, $target->isRequired(), 'isRequired() value not match');
$this->assertTrue($target->breakOnFailure(), 'breakOnFailure() value not match');
$this->assertTrue($target->isRequired(), 'isRequired() value not match');
$this->assertEquals($sourceRawValue, $target->getRawValue(), 'getRawValue() value not match');
$this->assertTrue($target->hasValue(), 'hasValue() value not match');
}
Expand All @@ -563,7 +574,7 @@ public function testInputMergeWithoutValues()
$return = $target->merge($source);
$this->assertSame($target, $return, 'merge() must return it self');

$this->assertEquals(true, $target->continueIfEmpty(), 'continueIfEmpty() value not match');
$this->assertTrue($target->continueIfEmpty(), 'continueIfEmpty() value not match');
$this->assertFalse($target->hasValue(), 'hasValue() value not match');
}

Expand All @@ -583,7 +594,7 @@ public function testInputMergeWithSourceValue()
$return = $target->merge($source);
$this->assertSame($target, $return, 'merge() must return it self');

$this->assertEquals(true, $target->continueIfEmpty(), 'continueIfEmpty() value not match');
$this->assertTrue($target->continueIfEmpty(), 'continueIfEmpty() value not match');
$this->assertEquals(['foo'], $target->getRawValue(), 'getRawValue() value not match');
$this->assertTrue($target->hasValue(), 'hasValue() value not match');
}
Expand All @@ -604,7 +615,7 @@ public function testInputMergeWithTargetValue()
$return = $target->merge($source);
$this->assertSame($target, $return, 'merge() must return it self');

$this->assertEquals(true, $target->continueIfEmpty(), 'continueIfEmpty() value not match');
$this->assertTrue($target->continueIfEmpty(), 'continueIfEmpty() value not match');
$this->assertEquals(['foo'], $target->getRawValue(), 'getRawValue() value not match');
$this->assertTrue($target->hasValue(), 'hasValue() value not match');
}
Expand Down