From 181d5480c6e4efcd8e297222949438c26d77cc7c Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Wed, 9 Jun 2021 12:32:05 +0200 Subject: [PATCH] [Validator] Fix tests by making constraint options dumps order consistent --- src/Symfony/Component/Validator/Command/DebugCommand.php | 2 ++ .../Component/Validator/Tests/Command/DebugCommandTest.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Validator/Command/DebugCommand.php b/src/Symfony/Component/Validator/Command/DebugCommand.php index 0f0912ea46..04f2f4af25 100644 --- a/src/Symfony/Component/Validator/Command/DebugCommand.php +++ b/src/Symfony/Component/Validator/Command/DebugCommand.php @@ -165,6 +165,8 @@ EOF $options[$propertyName] = $constraint->$propertyName; } + ksort($options); + return $options; } diff --git a/src/Symfony/Component/Validator/Tests/Command/DebugCommandTest.php b/src/Symfony/Component/Validator/Tests/Command/DebugCommandTest.php index 0f2b7b17f6..f6d1691662 100644 --- a/src/Symfony/Component/Validator/Tests/Command/DebugCommandTest.php +++ b/src/Symfony/Component/Validator/Tests/Command/DebugCommandTest.php @@ -72,8 +72,8 @@ Symfony\Component\Validator\Tests\Dummy\DummyClassOne | Property | Name | Groups | Options | +---------------+--------------------------------------------------+---------+------------------------------------------------------------+ | firstArgument | Symfony\Component\Validator\Constraints\NotBlank | Default | [ | -| | | | "message" => "This value should not be blank.", | | | | | "allowNull" => false, | +| | | | "message" => "This value should not be blank.", | | | | | "normalizer" => null, | | | | | "payload" => null | | | | | ] | @@ -133,8 +133,8 @@ Symfony\Component\Validator\Tests\Dummy\DummyClassOne | Property | Name | Groups | Options | +---------------+--------------------------------------------------+---------+------------------------------------------------------------+ | firstArgument | Symfony\Component\Validator\Constraints\NotBlank | Default | [ | -| | | | "message" => "This value should not be blank.", | | | | | "allowNull" => false, | +| | | | "message" => "This value should not be blank.", | | | | | "normalizer" => null, | | | | | "payload" => null | | | | | ] | @@ -153,8 +153,8 @@ Symfony\Component\Validator\Tests\Dummy\DummyClassTwo | Property | Name | Groups | Options | +---------------+--------------------------------------------------+---------+------------------------------------------------------------+ | firstArgument | Symfony\Component\Validator\Constraints\NotBlank | Default | [ | -| | | | "message" => "This value should not be blank.", | | | | | "allowNull" => false, | +| | | | "message" => "This value should not be blank.", | | | | | "normalizer" => null, | | | | | "payload" => null | | | | | ] |