Skip to content

Commit 0473d10

Browse files
author
Michael Logvin
committed
Merge branch 'MAGETWO-28011' of github.corp.ebay.com:magento-firedrakes/magento2ce into MAGETWO-28011
2 parents dcaa9a7 + 36e34dc commit 0473d10

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111

1212
class Timezone implements \Magento\Framework\Option\ArrayInterface
1313
{
14+
/**
15+
* Timezones that works incorrect with php_intl extension
16+
*/
17+
const IGNORED_TIMEZONES = [
18+
'Antarctica/Troll',
19+
'Asia/Chita',
20+
'Asia/Srednekolymsk',
21+
'Pacific/Bougainville'
22+
];
23+
1424
/**
1525
* @var \Magento\Framework\Locale\ListsInterface
1626
*/
@@ -29,6 +39,14 @@ public function __construct(\Magento\Framework\Locale\ListsInterface $localeList
2939
*/
3040
public function toOptionArray()
3141
{
32-
return $this->_localeLists->getOptionTimezones();
42+
$timezones = $this->_localeLists->getOptionTimezones();
43+
$timezones = array_filter($timezones, function($value) {
44+
if (in_array($value['value'], static::IGNORED_TIMEZONES)) {
45+
return false;
46+
}
47+
return true;
48+
});
49+
50+
return $timezones;
3351
}
3452
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Config\Test\Unit\Model\Config\Locale;
7+
8+
class LoaderTest extends \PHPUnit_Framework_TestCase
9+
{
10+
/**
11+
* @var \PHPUnit_Framework_MockObject_MockObject
12+
*/
13+
protected $listMock;
14+
15+
/**
16+
* @var \Magento\Config\Model\Config\Source\Locale\Timezone
17+
*/
18+
protected $model;
19+
20+
protected function setUp()
21+
{
22+
$this->listMock = $this->getMockBuilder('Magento\Framework\Locale\TranslatedLists')
23+
->disableOriginalConstructor()
24+
->getMock();
25+
$this->model = new \Magento\Config\Model\Config\Source\Locale\Timezone($this->listMock);
26+
}
27+
28+
public function testToOptionArray()
29+
{
30+
$list = \DateTimeZone::listIdentifiers();
31+
$preparedList = [];
32+
foreach ($list as $value) {
33+
$preparedList[] = ['value' => $value, 'label' => $value];
34+
}
35+
$this->listMock->expects($this->once())
36+
->method('getOptionTimezones')
37+
->willReturn($preparedList);
38+
$result = $this->model->toOptionArray();
39+
foreach ($result as $value) {
40+
if (in_array($value['value'], \Magento\Config\Model\Config\Source\Locale\Timezone::IGNORED_TIMEZONES)) {
41+
$this->fail('Locale ' . $value['value'] . ' shouldn\'t be presented');
42+
}
43+
}
44+
}
45+
}

app/code/Magento/Sales/Model/Order.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ public function setCanSendNewEmailFlag($flag)
427427
/**
428428
* Load order by system increment identifier
429429
*
430+
* @deprecated
430431
* @param string $incrementId
431432
* @return \Magento\Sales\Model\Order
432433
*/

dev/tests/functional/tests/app/Magento/Cms/Test/Page/CmsIndex.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
<block name="currencyBlock" class="Magento\Directory\Test\Block\Currency\Switcher" locator=".switcher.currency" strategy="css selector" />
1919
<block name="cmsPageBlock" class="Magento\Cms\Test\Block\Page" locator=".page-main" strategy="css selector" />
2020
<block name="widgetView" class="Magento\Widget\Test\Block\WidgetView" locator=".widget" strategy="css selector" />
21+
<block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator=".messages" strategy="css selector"/>
2122
</page>
2223
</config>

0 commit comments

Comments
 (0)