File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Model/Config/Source/Locale
Test/Unit/Model/Config/Source/Locale Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class Timezone implements \Magento\Framework\Option\ArrayInterface
14
14
/**
15
15
* Timezones that works incorrect with php_intl extension
16
16
*/
17
- const IGNORED_TIMEZONES = [
17
+ protected $ ignoredTimezones = [
18
18
'Antarctica/Troll ' ,
19
19
'Asia/Chita ' ,
20
20
'Asia/Srednekolymsk ' ,
@@ -41,7 +41,7 @@ public function toOptionArray()
41
41
{
42
42
$ timezones = $ this ->_localeLists ->getOptionTimezones ();
43
43
$ timezones = array_filter ($ timezones , function ($ value ) {
44
- if (in_array ($ value ['value ' ], static :: IGNORED_TIMEZONES )) {
44
+ if (in_array ($ value ['value ' ], $ this -> ignoredTimezones )) {
45
45
return false ;
46
46
}
47
47
return true ;
Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ protected function setUp()
27
27
28
28
public function testToOptionArray ()
29
29
{
30
+ $ ignoredTimezones = [
31
+ 'Antarctica/Troll ' ,
32
+ 'Asia/Chita ' ,
33
+ 'Asia/Srednekolymsk ' ,
34
+ 'Pacific/Bougainville '
35
+ ];
30
36
$ list = \DateTimeZone::listIdentifiers ();
31
37
$ preparedList = [];
32
38
foreach ($ list as $ value ) {
@@ -37,7 +43,7 @@ public function testToOptionArray()
37
43
->willReturn ($ preparedList );
38
44
$ result = $ this ->model ->toOptionArray ();
39
45
foreach ($ result as $ value ) {
40
- if (in_array ($ value ['value ' ], \ Magento \ Config \ Model \ Config \ Source \ Locale \Timezone:: IGNORED_TIMEZONES )) {
46
+ if (in_array ($ value ['value ' ], $ ignoredTimezones )) {
41
47
$ this ->fail ('Locale ' . $ value ['value ' ] . ' shouldn \'t be presented ' );
42
48
}
43
49
}
You can’t perform that action at this time.
0 commit comments