'1.', 1.
],
['1.0', 1.
],
['1.23', 1.23
],
];
} /**
* @dataProvider provideTransformations
*/
public function testTransform($from,
$to) { $transformer =
new StringToFloatTransformer();
$this->
assertSame($to,
$transformer->
transform($from));
} public function testFailIfTransformingANonString() { $this->
expectException(TransformationFailedException::
class);
$transformer =
new StringToFloatTransformer();
$transformer->
transform(1.0
);
}