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

Commit f2b6fa2

Browse files
committed
Rename property input > inputfilter
1 parent 6c42293 commit f2b6fa2

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

test/CollectionInputFilterTest.php

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ class CollectionInputFilterTest extends TestCase
2727
/**
2828
* @var CollectionInputFilter
2929
*/
30-
protected $filter;
30+
protected $inputFilter;
3131

3232
public function setUp()
3333
{
34-
$this->filter = new CollectionInputFilter();
34+
$this->inputFilter = new CollectionInputFilter();
3535
}
3636

3737
public function testSetDataWithInvalidDataTypeThrowsInvalidArgumentException()
3838
{
39-
$inputFilter = $this->filter;
39+
$inputFilter = $this->inputFilter;
4040

4141
$this->setExpectedException(
4242
RuntimeException::class,
@@ -51,23 +51,23 @@ public function testSetDataWithInvalidDataTypeThrowsInvalidArgumentException()
5151
*/
5252
public function testSetInputFilter($inputFilter, $expectedType)
5353
{
54-
$this->filter->setInputFilter($inputFilter);
54+
$this->inputFilter->setInputFilter($inputFilter);
5555

56-
$this->assertInstanceOf($expectedType, $this->filter->getInputFilter(), 'getInputFilter() type not match');
56+
$this->assertInstanceOf($expectedType, $this->inputFilter->getInputFilter(), 'getInputFilter() type not match');
5757
}
5858

5959
public function testGetDefaultInputFilter()
6060
{
61-
$this->assertInstanceOf(BaseInputFilter::class, $this->filter->getInputFilter());
61+
$this->assertInstanceOf(BaseInputFilter::class, $this->inputFilter->getInputFilter());
6262
}
6363

6464
/**
6565
* @dataProvider isRequiredProvider
6666
*/
6767
public function testSetRequired($value)
6868
{
69-
$this->filter->setIsRequired($value);
70-
$this->assertEquals($value, $this->filter->getIsRequired());
69+
$this->inputFilter->setIsRequired($value);
70+
$this->assertEquals($value, $this->inputFilter->getIsRequired());
7171
}
7272

7373
/**
@@ -76,13 +76,13 @@ public function testSetRequired($value)
7676
public function testSetCount($count, $data, $expectedCount)
7777
{
7878
if ($count !== null) {
79-
$this->filter->setCount($count);
79+
$this->inputFilter->setCount($count);
8080
}
8181
if ($data !== null) {
82-
$this->filter->setData($data);
82+
$this->inputFilter->setData($data);
8383
}
8484

85-
$this->assertEquals($expectedCount, $this->filter->getCount(), 'getCount() value not match');
85+
$this->assertEquals($expectedCount, $this->inputFilter->getCount(), 'getCount() value not match');
8686
}
8787

8888
/**
@@ -99,19 +99,19 @@ public function testGetCountReturnsRightCountOnConsecutiveCallsWithDifferentData
9999
['foo' => 'bar'],
100100
];
101101

102-
$this->filter->setData($collectionData1);
103-
$this->assertEquals(2, $this->filter->getCount());
104-
$this->filter->setData($collectionData2);
105-
$this->assertEquals(1, $this->filter->getCount());
102+
$this->inputFilter->setData($collectionData1);
103+
$this->assertEquals(2, $this->inputFilter->getCount());
104+
$this->inputFilter->setData($collectionData2);
105+
$this->assertEquals(1, $this->inputFilter->getCount());
106106
}
107107

108108
public function testInvalidCollectionIsNotValid()
109109
{
110110
$data = 1;
111111

112-
$this->filter->setData($data);
112+
$this->inputFilter->setData($data);
113113

114-
$this->assertFalse($this->filter->isValid());
114+
$this->assertFalse($this->inputFilter->isValid());
115115
}
116116

117117
/**
@@ -127,21 +127,21 @@ public function testDataVsValid(
127127
$expectedValid,
128128
$expectedMessages
129129
) {
130-
$this->filter->setInputFilter($inputFilter);
131-
$this->filter->setData($data);
130+
$this->inputFilter->setInputFilter($inputFilter);
131+
$this->inputFilter->setData($data);
132132
if ($count !== null) {
133-
$this->filter->setCount($count);
133+
$this->inputFilter->setCount($count);
134134
}
135-
$this->filter->setIsRequired($required);
135+
$this->inputFilter->setIsRequired($required);
136136

137137
$this->assertEquals(
138138
$expectedValid,
139-
$this->filter->isValid(),
140-
'isValid() value not match. Detail . ' . json_encode($this->filter->getMessages())
139+
$this->inputFilter->isValid(),
140+
'isValid() value not match. Detail . ' . json_encode($this->inputFilter->getMessages())
141141
);
142-
$this->assertEquals($expectedRaw, $this->filter->getRawValues(), 'getRawValues() value not match');
143-
$this->assertEquals($expecteValues, $this->filter->getValues(), 'getValues() value not match');
144-
$this->assertEquals($expectedMessages, $this->filter->getMessages(), 'getMessages() value not match');
142+
$this->assertEquals($expectedRaw, $this->inputFilter->getRawValues(), 'getRawValues() value not match');
143+
$this->assertEquals($expecteValues, $this->inputFilter->getValues(), 'getValues() value not match');
144+
$this->assertEquals($expectedMessages, $this->inputFilter->getMessages(), 'getMessages() value not match');
145145
}
146146

147147
public function dataVsValidProvider()
@@ -215,17 +215,17 @@ public function testSetValidationGroupUsingFormStyle()
215215
->with($validationGroup)
216216
;
217217

218-
$this->filter->setInputFilter($baseInputFilter);
219-
$this->filter->setData($colRaw);
220-
$this->filter->setValidationGroup($colValidationGroup);
218+
$this->inputFilter->setInputFilter($baseInputFilter);
219+
$this->inputFilter->setData($colRaw);
220+
$this->inputFilter->setValidationGroup($colValidationGroup);
221221

222222
$this->assertTrue(
223-
$this->filter->isValid(),
224-
'isValid() value not match. Detail . ' . json_encode($this->filter->getMessages())
223+
$this->inputFilter->isValid(),
224+
'isValid() value not match. Detail . ' . json_encode($this->inputFilter->getMessages())
225225
);
226-
$this->assertEquals($colRaw, $this->filter->getRawValues(), 'getRawValues() value not match');
227-
$this->assertEquals($colFiltered, $this->filter->getValues(), 'getValues() value not match');
228-
$this->assertEquals([], $this->filter->getMessages(), 'getMessages() value not match');
226+
$this->assertEquals($colRaw, $this->inputFilter->getRawValues(), 'getRawValues() value not match');
227+
$this->assertEquals($colFiltered, $this->inputFilter->getValues(), 'getValues() value not match');
228+
$this->assertEquals([], $this->inputFilter->getMessages(), 'getMessages() value not match');
229229
}
230230

231231
public function dataNestingCollection()

0 commit comments

Comments
 (0)