File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828use Rector \CodingStyle \Rector \FuncCall \CountArrayToEmptyArrayComparisonRector ;
2929use Rector \Core \Configuration \Option ;
3030use Rector \Core \ValueObject \PhpVersion ;
31+ use Rector \DeadCode \Rector \Array_ \RemoveDuplicatedArrayKeyRector ;
3132use Rector \DeadCode \Rector \Assign \RemoveUnusedVariableAssignRector ;
3233use Rector \DeadCode \Rector \Concat \RemoveConcatAutocastRector ;
3334use Rector \DeadCode \Rector \Foreach_ \RemoveUnusedForeachKeyRector ;
113114 $ services ->set (RemoveUnusedVariableAssignRector::class);
114115 $ services ->set (FuncGetArgsToVariadicParamRector::class);
115116 $ services ->set (MakeInheritedMethodVisibilitySameAsParentRector::class);
117+ $ services ->set (RemoveDuplicatedArrayKeyRector::class);
116118};
Original file line number Diff line number Diff line change @@ -241,25 +241,28 @@ public function testDasherize()
241241 }
242242 }
243243
244- public function testOrdinal ()
244+ public function provideOrdinal ()
245245 {
246- $ suffixes = [
247- 'st ' => 1 ,
248- 'nd ' => 2 ,
249- 'rd ' => 3 ,
250- 'th ' => 4 ,
251- 'th ' => 11 ,
252- 'th ' => 20 ,
253- 'st ' => 21 ,
254- 'nd ' => 22 ,
255- 'rd ' => 23 ,
256- 'th ' => 24 ,
246+ return [
247+ [ 'st ' , 1 ] ,
248+ [ 'nd ' , 2 ] ,
249+ [ 'rd ' , 3 ] ,
250+ [ 'th ' , 4 ] ,
251+ [ 'th ' , 11 ] ,
252+ [ 'th ' , 20 ] ,
253+ [ 'st ' , 21 ] ,
254+ [ 'nd ' , 22 ] ,
255+ [ 'rd ' , 23 ] ,
256+ [ 'th ' , 24 ] ,
257257 ];
258+ }
258259
259- foreach ($ suffixes as $ suffix => $ number ) {
260- $ ordinal = ordinal ($ number );
261- $ this ->assertSame ($ suffix , $ ordinal );
262- }
260+ /**
261+ * @dataProvider provideOrdinal
262+ */
263+ public function testOrdinal (string $ suffix , int $ number )
264+ {
265+ $ this ->assertSame ($ suffix , ordinal ($ number ));
263266 }
264267
265268 public function testOrdinalize ()
Original file line number Diff line number Diff line change @@ -148,42 +148,42 @@ public function creditCardProvider()
148148 '6011 0009 9013 9424 ' ,
149149 true ,
150150 ],
151- 'jcb1 ' => [
151+ 'jcb8 ' => [
152152 'jcb ' ,
153153 '3530 1113 3330 0000 ' ,
154154 true ,
155155 ],
156- 'jcb2 ' => [
156+ 'jcb9 ' => [
157157 'jcb ' ,
158158 '3566 0020 2036 0505 ' ,
159159 true ,
160160 ],
161- 'mastercard1 ' => [
161+ 'mastercard12 ' => [
162162 'mastercard ' ,
163163 '5555 5555 5555 4444 ' ,
164164 true ,
165165 ],
166- 'mastercard2 ' => [
166+ 'mastercard13 ' => [
167167 'mastercard ' ,
168168 '5105 1051 0510 5100 ' ,
169169 true ,
170170 ],
171- 'visa1 ' => [
171+ 'visa4 ' => [
172172 'visa ' ,
173173 '4111 1111 1111 1111 ' ,
174174 true ,
175175 ],
176- 'visa2 ' => [
176+ 'visa5 ' => [
177177 'visa ' ,
178178 '4012 8888 8888 1881 ' ,
179179 true ,
180180 ],
181- 'visa3 ' => [
181+ 'visa6 ' => [
182182 'visa ' ,
183183 '4222 2222 2222 2 ' ,
184184 true ,
185185 ],
186- 'dankort1 ' => [
186+ 'dankort5 ' => [
187187 'dankort ' ,
188188 '5019 7170 1010 3742 ' ,
189189 true ,
@@ -1203,12 +1203,12 @@ public function creditCardProvider()
12031203 $ this ->generateCardNum (500 , 16 ),
12041204 true ,
12051205 ],
1206- 'hsbc ' => [
1206+ 'hsbc1 ' => [
12071207 'hsbc ' ,
12081208 $ this ->generateCardNum (56 , 16 ),
12091209 true ,
12101210 ],
1211- 'hsbc ' => [
1211+ 'hsbc2 ' => [
12121212 'hsbc ' ,
12131213 $ this ->generateCardNum (57 , 16 ),
12141214 false ,
You can’t perform that action at this time.
0 commit comments