Skip to content

Commit 652ad25

Browse files
committed
Merge remote-tracking branch 'origin/AC-6656' into Hammer_Community_Backlog_21092022
2 parents e0d650c + f0b5ce3 commit 652ad25

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

lib/internal/Magento/Framework/Setup/Test/Unit/ListsTest.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ class ListsTest extends TestCase
2424
*/
2525
private $mockConfig;
2626

27-
/**
28-
* @var array
29-
*/
30-
private $expectedTimezones = [
31-
'Australia/Darwin',
32-
'America/Los_Angeles',
33-
'Europe/Kiev',
34-
'Asia/Jerusalem',
35-
];
36-
3727
/**
3828
* @var array
3929
*/
@@ -56,6 +46,16 @@ class ListsTest extends TestCase
5646
'sr_Latn_RS' => 'Serbian (Latin, Serbia)'
5747
];
5848

49+
private function getExpectedTimezones($timeZone): array
50+
{
51+
return [
52+
'Australia/Darwin',
53+
'America/Los_Angeles',
54+
$timeZone,
55+
'Asia/Jerusalem',
56+
];
57+
}
58+
5959
protected function setUp(): void
6060
{
6161
$this->mockConfig = $this->getMockBuilder(ConfigInterface::class)
@@ -71,8 +71,11 @@ protected function setUp(): void
7171

7272
public function testGetTimezoneList()
7373
{
74-
$timezones = array_intersect($this->expectedTimezones, array_keys($this->lists->getTimezoneList()));
75-
$this->assertEquals($this->expectedTimezones, $timezones);
74+
$resultTimezone = array_keys($this->lists->getTimezoneList());
75+
$timeZone = in_array('Europe/Kyiv', $resultTimezone) ? 'Europe/Kyiv' : 'Europe/Kiev';
76+
$expectedTimezones = $this->getExpectedTimezones($timeZone);
77+
$timezones = array_intersect($expectedTimezones, $resultTimezone);
78+
$this->assertEquals($expectedTimezones, $timezones);
7679
}
7780

7881
public function testGetLocaleList()

0 commit comments

Comments
 (0)