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 @@ -83,8 +83,10 @@ protected function setUp(): void
83
83
$ this ->validator = $ this ->createValidator ();
84
84
$ this ->validator ->initialize ($ this ->context );
85
85
86
- $ this ->defaultLocale = \Locale::getDefault ();
87
- \Locale::setDefault ('en ' );
86
+ if (class_exists (\Locale::class)) {
87
+ $ this ->defaultLocale = \Locale::getDefault ();
88
+ \Locale::setDefault ('en ' );
89
+ }
88
90
89
91
$ this ->expectedViolations = [];
90
92
$ this ->call = 0 ;
@@ -96,7 +98,9 @@ protected function tearDown(): void
96
98
{
97
99
$ this ->restoreDefaultTimezone ();
98
100
99
- \Locale::setDefault ($ this ->defaultLocale );
101
+ if (class_exists (\Locale::class)) {
102
+ \Locale::setDefault ($ this ->defaultLocale );
103
+ }
100
104
}
101
105
102
106
protected function setDefaultTimezone (?string $ defaultTimezone )
You can’t perform that action at this time.
0 commit comments