@@ -27,16 +27,16 @@ class CollectionInputFilterTest extends TestCase
27
27
/**
28
28
* @var CollectionInputFilter
29
29
*/
30
- protected $ filter ;
30
+ protected $ inputFilter ;
31
31
32
32
public function setUp ()
33
33
{
34
- $ this ->filter = new CollectionInputFilter ();
34
+ $ this ->inputFilter = new CollectionInputFilter ();
35
35
}
36
36
37
37
public function testSetDataWithInvalidDataTypeThrowsInvalidArgumentException ()
38
38
{
39
- $ inputFilter = $ this ->filter ;
39
+ $ inputFilter = $ this ->inputFilter ;
40
40
41
41
$ this ->setExpectedException (
42
42
RuntimeException::class,
@@ -51,23 +51,23 @@ public function testSetDataWithInvalidDataTypeThrowsInvalidArgumentException()
51
51
*/
52
52
public function testSetInputFilter ($ inputFilter , $ expectedType )
53
53
{
54
- $ this ->filter ->setInputFilter ($ inputFilter );
54
+ $ this ->inputFilter ->setInputFilter ($ inputFilter );
55
55
56
- $ this ->assertInstanceOf ($ expectedType , $ this ->filter ->getInputFilter (), 'getInputFilter() type not match ' );
56
+ $ this ->assertInstanceOf ($ expectedType , $ this ->inputFilter ->getInputFilter (), 'getInputFilter() type not match ' );
57
57
}
58
58
59
59
public function testGetDefaultInputFilter ()
60
60
{
61
- $ this ->assertInstanceOf (BaseInputFilter::class, $ this ->filter ->getInputFilter ());
61
+ $ this ->assertInstanceOf (BaseInputFilter::class, $ this ->inputFilter ->getInputFilter ());
62
62
}
63
63
64
64
/**
65
65
* @dataProvider isRequiredProvider
66
66
*/
67
67
public function testSetRequired ($ value )
68
68
{
69
- $ this ->filter ->setIsRequired ($ value );
70
- $ this ->assertEquals ($ value , $ this ->filter ->getIsRequired ());
69
+ $ this ->inputFilter ->setIsRequired ($ value );
70
+ $ this ->assertEquals ($ value , $ this ->inputFilter ->getIsRequired ());
71
71
}
72
72
73
73
/**
@@ -76,13 +76,13 @@ public function testSetRequired($value)
76
76
public function testSetCount ($ count , $ data , $ expectedCount )
77
77
{
78
78
if ($ count !== null ) {
79
- $ this ->filter ->setCount ($ count );
79
+ $ this ->inputFilter ->setCount ($ count );
80
80
}
81
81
if ($ data !== null ) {
82
- $ this ->filter ->setData ($ data );
82
+ $ this ->inputFilter ->setData ($ data );
83
83
}
84
84
85
- $ this ->assertEquals ($ expectedCount , $ this ->filter ->getCount (), 'getCount() value not match ' );
85
+ $ this ->assertEquals ($ expectedCount , $ this ->inputFilter ->getCount (), 'getCount() value not match ' );
86
86
}
87
87
88
88
/**
@@ -99,19 +99,19 @@ public function testGetCountReturnsRightCountOnConsecutiveCallsWithDifferentData
99
99
['foo ' => 'bar ' ],
100
100
];
101
101
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 ());
106
106
}
107
107
108
108
public function testInvalidCollectionIsNotValid ()
109
109
{
110
110
$ data = 1 ;
111
111
112
- $ this ->filter ->setData ($ data );
112
+ $ this ->inputFilter ->setData ($ data );
113
113
114
- $ this ->assertFalse ($ this ->filter ->isValid ());
114
+ $ this ->assertFalse ($ this ->inputFilter ->isValid ());
115
115
}
116
116
117
117
/**
@@ -127,21 +127,21 @@ public function testDataVsValid(
127
127
$ expectedValid ,
128
128
$ expectedMessages
129
129
) {
130
- $ this ->filter ->setInputFilter ($ inputFilter );
131
- $ this ->filter ->setData ($ data );
130
+ $ this ->inputFilter ->setInputFilter ($ inputFilter );
131
+ $ this ->inputFilter ->setData ($ data );
132
132
if ($ count !== null ) {
133
- $ this ->filter ->setCount ($ count );
133
+ $ this ->inputFilter ->setCount ($ count );
134
134
}
135
- $ this ->filter ->setIsRequired ($ required );
135
+ $ this ->inputFilter ->setIsRequired ($ required );
136
136
137
137
$ this ->assertEquals (
138
138
$ 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 ())
141
141
);
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 ' );
145
145
}
146
146
147
147
public function dataVsValidProvider ()
@@ -215,17 +215,17 @@ public function testSetValidationGroupUsingFormStyle()
215
215
->with ($ validationGroup )
216
216
;
217
217
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 );
221
221
222
222
$ 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 ())
225
225
);
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 ' );
229
229
}
230
230
231
231
public function dataNestingCollection ()
0 commit comments