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