add a test case
This commit is contained in:
parent
d903dcbac5
commit
85af682834
@ -514,24 +514,24 @@ class NumberToLocalizedStringTransformerTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
|
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
|
||||||
|
* @dataProvider nanRepresentationProvider
|
||||||
*
|
*
|
||||||
* @see https://github.com/symfony/symfony/issues/3161
|
* @see https://github.com/symfony/symfony/issues/3161
|
||||||
*/
|
*/
|
||||||
public function testReverseTransformDisallowsNaN()
|
public function testReverseTransformDisallowsNaN($nan)
|
||||||
{
|
{
|
||||||
$transformer = new NumberToLocalizedStringTransformer();
|
$transformer = new NumberToLocalizedStringTransformer();
|
||||||
|
|
||||||
$transformer->reverseTransform('NaN');
|
$transformer->reverseTransform($nan);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function nanRepresentationProvider()
|
||||||
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
|
|
||||||
*/
|
|
||||||
public function testReverseTransformDisallowsNaN2()
|
|
||||||
{
|
{
|
||||||
$transformer = new NumberToLocalizedStringTransformer();
|
return array(
|
||||||
|
array('nan'),
|
||||||
$transformer->reverseTransform('nan');
|
array('NaN'), // see https://github.com/symfony/symfony/issues/3161
|
||||||
|
array('NAN'),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user