Skip to content

Commit e592767

Browse files
author
Michael Logvin
committed
MAGETWO-37616: Prepare PR
1 parent 0473d10 commit e592767

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/code/Magento/Config/Model/Config/Source/Locale/Timezone.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Timezone implements \Magento\Framework\Option\ArrayInterface
1414
/**
1515
* Timezones that works incorrect with php_intl extension
1616
*/
17-
const IGNORED_TIMEZONES = [
17+
protected $ignoredTimezones = [
1818
'Antarctica/Troll',
1919
'Asia/Chita',
2020
'Asia/Srednekolymsk',
@@ -41,7 +41,7 @@ public function toOptionArray()
4141
{
4242
$timezones = $this->_localeLists->getOptionTimezones();
4343
$timezones = array_filter($timezones, function($value) {
44-
if (in_array($value['value'], static::IGNORED_TIMEZONES)) {
44+
if (in_array($value['value'], $this->ignoredTimezones)) {
4545
return false;
4646
}
4747
return true;

app/code/Magento/Config/Test/Unit/Model/Config/Source/Locale/TimezoneTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ protected function setUp()
2727

2828
public function testToOptionArray()
2929
{
30+
$ignoredTimezones = [
31+
'Antarctica/Troll',
32+
'Asia/Chita',
33+
'Asia/Srednekolymsk',
34+
'Pacific/Bougainville'
35+
];
3036
$list = \DateTimeZone::listIdentifiers();
3137
$preparedList = [];
3238
foreach ($list as $value) {
@@ -37,7 +43,7 @@ public function testToOptionArray()
3743
->willReturn($preparedList);
3844
$result = $this->model->toOptionArray();
3945
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)) {
4147
$this->fail('Locale ' . $value['value'] . ' shouldn\'t be presented');
4248
}
4349
}

0 commit comments

Comments
 (0)