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

Commit 07a96ae

Browse files
committed
Fix tests, remove whitespace
1 parent 4a4fb30 commit 07a96ae

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/Factory.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,12 @@ public function createInputFilter($inputFilterSpecification)
307307
}
308308

309309
$type = InputFilter::class;
310-
310+
311311
if (isset($inputFilterSpecification['type']) && is_string($inputFilterSpecification['type'])) {
312312
$type = $inputFilterSpecification['type'];
313313
unset($inputFilterSpecification['type']);
314314
}
315-
315+
316316
$inputFilter = $this->getInputFilterManager()->get($type);
317317

318318
if ($inputFilter instanceof CollectionInputFilter) {
@@ -339,17 +339,17 @@ public function createInputFilter($inputFilterSpecification)
339339
) {
340340
$input = $value;
341341
} else {
342-
342+
343343
// Patch to enable nested, integer indexed input_filter_specs
344-
// InputFilter doesn't have an name property!
344+
// InputFilter doesn't have an name property!
345345
// But if the key is an integer and type and name are specified maybe we could use it.
346346
if (is_integer($key) && isset($value['type']) && is_string($value['type'])) {
347347
if (isset($value['name']) && is_string($value['name'])) {
348348
$key = $value['name'];
349349
unset($value['name']);
350350
}
351351
}
352-
352+
353353
$input = $this->createInput($value);
354354
}
355355

test/FactoryTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -918,26 +918,28 @@ public function testCreateInputFilterConfiguredNameWhenSpecIsIntegerIndexed()
918918
$factory = $this->createDefaultFactory();
919919
$inputFilter = $factory->createInputFilter([
920920
1 => [
921+
'type' => InputFilter::class,
921922
'name' => 'foo',
922923
],
923924
]);
924925

925926
$this->assertTrue($inputFilter->has('foo'));
926927
}
927-
928+
928929
public function testCreateInputFilterUsesAssociatedNameMappingOverConfiguredName()
929930
{
930931
$factory = $this->createDefaultFactory();
931932
$inputFilter = $factory->createInputFilter([
932933
'foo' => [
934+
'type' => InputFilter::class,
933935
'name' => 'bar',
934936
],
935937
]);
936938

937939
$this->assertTrue($inputFilter->has('foo'));
938940
$this->assertFalse($inputFilter->has('bar'));
939941
}
940-
942+
941943
public function testCreateInputFilterUsesConfiguredNameForNestedInputFilters()
942944
{
943945
$factory = $this->createDefaultFactory();
@@ -979,7 +981,7 @@ public function testCreateInputFilterUsesConfiguredNameForNestedInputFilters()
979981
$this->assertEquals(1, count($collectionInputFilter));
980982
$this->assertTrue($collectionInputFilter->has('bat'));
981983
}
982-
984+
983985
/**
984986
* @return Factory
985987
*/

test/InputFilterAbstractServiceFactoryTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use PHPUnit_Framework_MockObject_MockObject as MockObject;
1414
use PHPUnit_Framework_TestCase as TestCase;
1515
use Zend\Filter\FilterPluginManager;
16-
use Zend\InputFilter\CollectionInputFilter;
1716
use Zend\InputFilter\InputFilterAbstractServiceFactory;
1817
use Zend\InputFilter\InputFilterInterface;
1918
use Zend\InputFilter\InputFilterPluginManager;

0 commit comments

Comments
 (0)