File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/Symfony/Component/Form/Tests/Extension/Core/Type Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 14
14
use Symfony \Component \Form \ChoiceList \View \ChoiceView ;
15
15
use Symfony \Component \Form \Extension \Core \Type \LocaleType ;
16
16
use Symfony \Component \Intl \Util \IntlTestHelper ;
17
+ use Symfony \Component \Validator \Constraints \Locale ;
17
18
18
19
class LocaleTypeTest extends BaseTypeTest
19
20
{
@@ -52,4 +53,15 @@ public function testInvalidChoiceValuesAreDropped()
52
53
53
54
$ this ->assertSame ([], $ type ->loadChoicesForValues (['foo ' ]));
54
55
}
56
+
57
+ public function testInvalidLocaleMessage ()
58
+ {
59
+ $ form = $ this ->factory ->create (static ::TESTED_TYPE );
60
+
61
+ $ form ->submit ('nonexistent-locale ' );
62
+
63
+ $ localeConstraint = new Locale ();
64
+
65
+ $ this ->assertSame ($ localeConstraint ->message , $ form ->getErrors ()->current ()->getMessage ());
66
+ }
55
67
}
You can’t perform that action at this time.
0 commit comments