File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/Symfony/Component/Validator/Test Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,10 @@ protected function setUp(): void
80
80
$ this ->validator = $ this ->createValidator ();
81
81
$ this ->validator ->initialize ($ this ->context );
82
82
83
- $ this ->defaultLocale = \Locale::getDefault ();
84
- \Locale::setDefault ('en ' );
83
+ if (class_exists (\Locale::class)) {
84
+ $ this ->defaultLocale = \Locale::getDefault ();
85
+ \Locale::setDefault ('en ' );
86
+ }
85
87
86
88
$ this ->expectedViolations = [];
87
89
$ this ->call = 0 ;
@@ -93,7 +95,9 @@ protected function tearDown(): void
93
95
{
94
96
$ this ->restoreDefaultTimezone ();
95
97
96
- \Locale::setDefault ($ this ->defaultLocale );
98
+ if (class_exists (\Locale::class)) {
99
+ \Locale::setDefault ($ this ->defaultLocale );
100
+ }
97
101
}
98
102
99
103
protected function setDefaultTimezone (?string $ defaultTimezone )
You can’t perform that action at this time.
0 commit comments