1212namespace Symfony \Component \Form \Tests ;
1313
1414use PHPUnit \Framework \SkippedTestError ;
15+ use Symfony \Component \Form \Extension \Core \DataTransformer \PercentToLocalizedStringTransformer ;
1516use Symfony \Component \Form \Extension \Core \Type \PercentType ;
1617use Symfony \Component \Form \Extension \Core \Type \SubmitType ;
1718use Symfony \Component \Form \Extension \Csrf \CsrfExtension ;
@@ -1923,7 +1924,7 @@ public function testPasswordWithMaxLength()
19231924
19241925 public function testPercent ()
19251926 {
1926- $ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\PercentType ' , 0.1 );
1927+ $ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\PercentType ' , 0.1 , [ ' rounding_mode ' => PercentToLocalizedStringTransformer:: ROUND_CEILING ] );
19271928
19281929 $ this ->assertWidgetMatchesXpath ($ form ->createView (), [],
19291930'/input
@@ -1939,7 +1940,7 @@ public function testPercentNoSymbol()
19391940 {
19401941 $ this ->requiresFeatureSet (403 );
19411942
1942- $ form = $ this ->factory ->createNamed ('name ' , PercentType::class, 0.1 , ['symbol ' => false ]);
1943+ $ form = $ this ->factory ->createNamed ('name ' , PercentType::class, 0.1 , ['symbol ' => false , ' rounding_mode ' => PercentToLocalizedStringTransformer:: ROUND_CEILING ]);
19431944 $ this ->assertWidgetMatchesXpath ($ form ->createView (), [],
19441945'/input
19451946 [@type="text"]
@@ -1954,7 +1955,7 @@ public function testPercentCustomSymbol()
19541955 {
19551956 $ this ->requiresFeatureSet (403 );
19561957
1957- $ form = $ this ->factory ->createNamed ('name ' , PercentType::class, 0.1 , ['symbol ' => '‱ ' ]);
1958+ $ form = $ this ->factory ->createNamed ('name ' , PercentType::class, 0.1 , ['symbol ' => '‱ ' , ' rounding_mode ' => PercentToLocalizedStringTransformer:: ROUND_CEILING ]);
19581959 $ this ->assertWidgetMatchesXpath ($ form ->createView (), [],
19591960'/input
19601961 [@type="text"]
0 commit comments