@@ -35,24 +35,22 @@ protected function setUp(): void
3535 public static function provideValidNumericValues (): array
3636 {
3737 return [
38- [10 , 10.0 ],
39- [-5 , -5.0 ],
40- [0 , 0.0 ],
41-
42- [10.5 , 10.5 ],
43- [-3.14 , -3.14 ],
44-
45- ['10 ' , 10.0 ],
46- ['10.5 ' , 10.5 ],
47- ['-2 ' , -2.0 ],
48-
49- [' 12 ' , 12.0 ],
50- [' 3.14 ' , 3.14 ],
38+ 'positive int ' => [10 , 10 ],
39+ 'negative int ' => [-5 , -5 ],
40+ 'zero ' => [0 , 0 ],
41+ 'positive float ' => [10.5 , 10.5 ],
42+ 'negative float ' => [-3.14 , -3.14 ],
43+ 'string positive int ' => ['10 ' , 10 ],
44+ 'string positive float ' => ['10.5 ' , 10.5 ],
45+ 'string negative int ' => ['-2 ' , -2 ],
46+ 'string positive int with extra spaces ' => [' 12 ' , 12 ],
47+ 'string positive float with extra spaces ' => [' 3.14 ' , 3.14 ],
48+ 'string positive power float with extra spaces ' => [' 3e14 ' , 3e14 ],
5149 ];
5250 }
5351
5452 #[DataProvider('provideValidNumericValues ' )]
55- public function testParseValidValues (mixed $ input , float $ expected ): void
53+ public function testParseValidValues (mixed $ input , int | float $ expected ): void
5654 {
5755 self ::assertSame ($ expected , $ this ->field ->parse ($ input ));
5856 }
0 commit comments