Skip to content

Commit 536e19b

Browse files
[Form] deprecate NumberToLocalizedStringTransformer::ROUND_* constants
1 parent 6556698 commit 536e19b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Tests/Extension/AbstractBootstrap3LayoutTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bridge\Twig\Tests\Extension;
1313

14-
use Symfony\Component\Form\Extension\Core\DataTransformer\PercentToLocalizedStringTransformer;
1514
use Symfony\Component\Form\Extension\Core\Type\PercentType;
1615
use Symfony\Component\Form\FormError;
1716
use Symfony\Component\Form\Tests\AbstractLayoutTest;
@@ -2212,7 +2211,7 @@ public function testPasswordWithMaxLength()
22122211

22132212
public function testPercent()
22142213
{
2215-
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\PercentType', 0.1, ['rounding_mode' => PercentToLocalizedStringTransformer::ROUND_CEILING]);
2214+
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\PercentType', 0.1, ['rounding_mode' => \NumberFormatter::ROUND_CEILING]);
22162215

22172216
$this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']],
22182217
'/div
@@ -2234,7 +2233,7 @@ public function testPercent()
22342233

22352234
public function testPercentNoSymbol()
22362235
{
2237-
$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => false, 'rounding_mode' => PercentToLocalizedStringTransformer::ROUND_CEILING]);
2236+
$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => false, 'rounding_mode' => \NumberFormatter::ROUND_CEILING]);
22382237
$this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']],
22392238
'/input
22402239
[@id="my&id"]
@@ -2248,7 +2247,7 @@ public function testPercentNoSymbol()
22482247

22492248
public function testPercentCustomSymbol()
22502249
{
2251-
$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => '', 'rounding_mode' => PercentToLocalizedStringTransformer::ROUND_CEILING]);
2250+
$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => '', 'rounding_mode' => \NumberFormatter::ROUND_CEILING]);
22522251
$this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']],
22532252
'/div
22542253
[@class="input-group"]

Tests/Extension/AbstractBootstrap4LayoutTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bridge\Twig\Tests\Extension;
1313

14-
use Symfony\Component\Form\Extension\Core\DataTransformer\PercentToLocalizedStringTransformer;
1514
use Symfony\Component\Form\Extension\Core\Type\ButtonType;
1615
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
1716
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
@@ -1169,7 +1168,7 @@ public function testMoney()
11691168

11701169
public function testPercent()
11711170
{
1172-
$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['rounding_mode' => PercentToLocalizedStringTransformer::ROUND_CEILING]);
1171+
$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['rounding_mode' => \NumberFormatter::ROUND_CEILING]);
11731172

11741173
$this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']],
11751174
'/div
@@ -1195,7 +1194,7 @@ public function testPercent()
11951194

11961195
public function testPercentNoSymbol()
11971196
{
1198-
$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => false, 'rounding_mode' => PercentToLocalizedStringTransformer::ROUND_CEILING]);
1197+
$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => false, 'rounding_mode' => \NumberFormatter::ROUND_CEILING]);
11991198
$this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']],
12001199
'/input
12011200
[@id="my&id"]
@@ -1209,7 +1208,7 @@ public function testPercentNoSymbol()
12091208

12101209
public function testPercentCustomSymbol()
12111210
{
1212-
$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => '', 'rounding_mode' => PercentToLocalizedStringTransformer::ROUND_CEILING]);
1211+
$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => '', 'rounding_mode' => \NumberFormatter::ROUND_CEILING]);
12131212
$this->assertWidgetMatchesXpath($form->createView(), ['id' => 'my&id', 'attr' => ['class' => 'my&class']],
12141213
'/div
12151214
[@class="input-group"]

0 commit comments

Comments
 (0)