Skip to content

Commit 06be96e

Browse files
authored
Merge pull request #7520 from magento-atwix-pyrrans/AC-2425-update-elasticsearch-7.17
[Pyrrans] Delivery bunch 2022`W11
2 parents d6756f9 + 9fff19a commit 06be96e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+18854
-19185
lines changed

app/code/Magento/Captcha/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"magento/module-authorization": "*",
1616
"laminas/laminas-captcha": "^2.11.0",
1717
"laminas/laminas-db": "^2.13.4",
18-
"laminas/laminas-session": "^2.12.0"
18+
"laminas/laminas-session": "^2.12.1"
1919
},
2020
"type": "magento2-module",
2121
"license": [

app/code/Magento/Directory/Helper/Data.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,36 +33,36 @@ class Data extends AbstractHelper
3333
/**
3434
* Config value that lists ISO2 country codes which have optional Zip/Postal pre-configured
3535
*/
36-
const OPTIONAL_ZIP_COUNTRIES_CONFIG_PATH = 'general/country/optional_zip_countries';
36+
public const OPTIONAL_ZIP_COUNTRIES_CONFIG_PATH = 'general/country/optional_zip_countries';
3737

3838
/*
3939
* Path to config value, which lists countries, for which state is required.
4040
*/
41-
const XML_PATH_STATES_REQUIRED = 'general/region/state_required';
41+
public const XML_PATH_STATES_REQUIRED = 'general/region/state_required';
4242

4343
/*
4444
* Path to config value, which detects whether or not display the state for the country, if it is not required
4545
*/
46-
const XML_PATH_DISPLAY_ALL_STATES = 'general/region/display_all';
46+
public const XML_PATH_DISPLAY_ALL_STATES = 'general/region/display_all';
4747

4848
/**#@+
4949
* Path to config value, which is default country
5050
*/
51-
const XML_PATH_DEFAULT_COUNTRY = 'general/country/default';
52-
const XML_PATH_DEFAULT_LOCALE = 'general/locale/code';
53-
const XML_PATH_DEFAULT_TIMEZONE = 'general/locale/timezone';
51+
public const XML_PATH_DEFAULT_COUNTRY = 'general/country/default';
52+
public const XML_PATH_DEFAULT_LOCALE = 'general/locale/code';
53+
public const XML_PATH_DEFAULT_TIMEZONE = 'general/locale/timezone';
5454
/**#@-*/
5555

5656
/**
5757
* Path to config value that contains codes of the most used countries.
5858
* Such countries can be shown on the top of the country list.
5959
*/
60-
const XML_PATH_TOP_COUNTRIES = 'general/country/destinations';
60+
public const XML_PATH_TOP_COUNTRIES = 'general/country/destinations';
6161

6262
/**
6363
* Path to config value that contains weight unit
6464
*/
65-
const XML_PATH_WEIGHT_UNIT = 'general/locale/weight_unit';
65+
public const XML_PATH_WEIGHT_UNIT = 'general/locale/weight_unit';
6666

6767
/**
6868
* @var Collection
@@ -348,7 +348,7 @@ public function getRegionData()
348348
AllowedCountries::ALLOWED_COUNTRIES_PATH,
349349
$scope['type'],
350350
$scope['value']
351-
);
351+
) ?? '';
352352
$countryIds = explode(',', $allowedCountries);
353353
$collection = $this->_regCollectionFactory->create();
354354
$collection->addCountryFilter($countryIds)->load();

app/code/Magento/Directory/Test/Unit/Helper/DataTest.php

Lines changed: 91 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Magento\Framework\App\Helper\Context;
1919
use Magento\Framework\App\RequestInterface;
2020
use Magento\Framework\DataObject;
21+
use Magento\Framework\Exception\NoSuchEntityException;
2122
use Magento\Framework\Json\Helper\Data as JsonDataHelper;
2223
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
2324
use Magento\Store\Model\ScopeInterface;
@@ -111,39 +112,45 @@ protected function setUp(): void
111112
$this->_object = $objectManager->getObject(Data::class, $arguments);
112113
}
113114

114-
public function testGetRegionJson()
115-
{
115+
/**
116+
* @param string|null $configValue
117+
* @param array $countryIds
118+
* @param array $regionList
119+
* @param array $expectedDataToEncode
120+
*
121+
* @throws NoSuchEntityException
122+
* @dataProvider getRegionJsonDataProvider
123+
*/
124+
public function testGetRegionJson(
125+
?string $configValue,
126+
array $countryIds,
127+
array $regionList,
128+
array $expectedDataToEncode
129+
) {
116130
$this->scopeConfigMock->method('getValue')
117131
->willReturnMap(
118132
[
119133
[
120134
AllowedCountries::ALLOWED_COUNTRIES_PATH,
121135
ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
122136
null,
123-
'Country1,Country2'
137+
$configValue
124138
],
125139
[Data::XML_PATH_STATES_REQUIRED, ScopeInterface::SCOPE_STORE, null, '']
126140
]
127141
);
128-
$regions = [
129-
new DataObject(
130-
['country_id' => 'Country1', 'region_id' => 'r1', 'code' => 'r1-code', 'name' => 'r1-name']
131-
),
132-
new DataObject(
133-
['country_id' => 'Country1', 'region_id' => 'r2', 'code' => 'r2-code', 'name' => 'r2-name']
134-
),
135-
new DataObject(
136-
['country_id' => 'Country2', 'region_id' => 'r3', 'code' => 'r3-code', 'name' => 'r3-name']
137-
)
138-
];
142+
$regions = [];
143+
foreach ($regionList as $region) {
144+
$regions[] = new DataObject($region);
145+
}
139146
$regionIterator = new \ArrayIterator($regions);
140147

141148
$this->_regionCollection->expects(
142149
$this->once()
143150
)->method(
144151
'addCountryFilter'
145152
)->with(
146-
['Country1', 'Country2']
153+
$countryIds
147154
)->willReturnSelf();
148155
$this->_regionCollection->expects($this->once())->method('load');
149156
$this->_regionCollection->expects(
@@ -153,15 +160,6 @@ public function testGetRegionJson()
153160
)->willReturn(
154161
$regionIterator
155162
);
156-
157-
$expectedDataToEncode = [
158-
'config' => ['show_all_regions' => false, 'regions_required' => []],
159-
'Country1' => [
160-
'r1' => ['code' => 'r1-code', 'name' => 'r1-name'],
161-
'r2' => ['code' => 'r2-code', 'name' => 'r2-name']
162-
],
163-
'Country2' => ['r3' => ['code' => 'r3-code', 'name' => 'r3-name']]
164-
];
165163
$this->jsonHelperMock->expects(
166164
$this->once()
167165
)->method(
@@ -177,6 +175,75 @@ public function testGetRegionJson()
177175
$this->assertEquals('encoded_json', $result);
178176
}
179177

178+
/**
179+
* @return array
180+
*/
181+
public function getRegionJsonDataProvider(): array
182+
{
183+
return [
184+
[
185+
'Country1,Country2',
186+
[
187+
'Country1',
188+
'Country2',
189+
],
190+
[
191+
[
192+
'country_id' => 'Country1',
193+
'region_id' => 'r1',
194+
'code' => 'r1-code',
195+
'name' => 'r1-name',
196+
],
197+
[
198+
'country_id' => 'Country1',
199+
'region_id' => 'r2',
200+
'code' => 'r2-code',
201+
'name' => 'r2-name',
202+
],
203+
[
204+
'country_id' => 'Country2',
205+
'region_id' => 'r3',
206+
'code' => 'r3-code',
207+
'name' => 'r3-name',
208+
],
209+
],
210+
[
211+
'config' => [
212+
'show_all_regions' => false,
213+
'regions_required' => [],
214+
],
215+
'Country1' => [
216+
'r1' => [
217+
'code' => 'r1-code',
218+
'name' => 'r1-name',
219+
],
220+
'r2' => [
221+
'code' => 'r2-code',
222+
'name' => 'r2-name',
223+
],
224+
],
225+
'Country2' => [
226+
'r3' => [
227+
'code' => 'r3-code',
228+
'name' => 'r3-name',
229+
]
230+
],
231+
],
232+
],
233+
[
234+
null,
235+
[''],
236+
[],
237+
[
238+
'config' => [
239+
'show_all_regions' => false,
240+
'regions_required' => [],
241+
],
242+
],
243+
],
244+
];
245+
}
246+
180247
/**
181248
* @param string $configValue
182249
* @param mixed $expected

app/code/Magento/GraphQl/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"magento/module-webapi": "*",
1010
"magento/module-new-relic-reporting": "*",
1111
"magento/module-authorization": "*",
12-
"webonyx/graphql-php": "~14.11.3"
12+
"webonyx/graphql-php": "~14.11.5"
1313
},
1414
"suggest": {
1515
"magento/module-graph-ql-cache": "*"

app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@
2929
*/
3030
class UnitBaseCalculatorTest extends TestCase
3131
{
32-
const STORE_ID = 2300;
33-
const QUANTITY = 1;
34-
const UNIT_PRICE = 500;
35-
const RATE = 10;
36-
const STORE_RATE = 11;
37-
38-
const CODE = 'CODE';
39-
const TYPE = 'TYPE';
40-
const ROW_TAX = 44.958682408681;
41-
const ROW_TAX_ROUNDED = 44.95;
42-
const PRICE_INCL_TAX = 495.4954954955;
43-
const PRICE_INCL_TAX_ROUNDED = 495.50;
32+
public const STORE_ID = 2300;
33+
public const QUANTITY = 1;
34+
public const UNIT_PRICE = 500;
35+
public const RATE = 10;
36+
public const STORE_RATE = 11;
37+
38+
public const CODE = 'CODE';
39+
public const TYPE = 'TYPE';
40+
public const ROW_TAX = 44.958682408681;
41+
public const ROW_TAX_ROUNDED = 44.95;
42+
public const PRICE_INCL_TAX = 495.4954954955;
43+
public const PRICE_INCL_TAX_ROUNDED = 495.50;
4444

4545
/** @var MockObject */
4646
protected $taxDetailsItemDataObjectFactoryMock;
@@ -161,13 +161,13 @@ public function testCalculateWithTaxInPrice()
161161
$this->assertSame($this->taxDetailsItem, $this->model->calculate($mockItem, self::QUANTITY));
162162
$this->assertSame(self::CODE, $this->taxDetailsItem->getCode());
163163
$this->assertSame(self::TYPE, $this->taxDetailsItem->getType());
164-
$this->assertSame(self::ROW_TAX_ROUNDED, $this->taxDetailsItem->getRowTax());
164+
$this->assertEquals(self::ROW_TAX_ROUNDED, $this->taxDetailsItem->getRowTax());
165165
$this->assertEquals(self::PRICE_INCL_TAX_ROUNDED, $this->taxDetailsItem->getPriceInclTax());
166166

167167
$this->assertSame($this->taxDetailsItem, $this->model->calculate($mockItem, self::QUANTITY, false));
168168
$this->assertSame(self::CODE, $this->taxDetailsItem->getCode());
169169
$this->assertSame(self::TYPE, $this->taxDetailsItem->getType());
170-
$this->assertSame(self::ROW_TAX, $this->taxDetailsItem->getRowTax());
170+
$this->assertEquals(self::ROW_TAX, $this->taxDetailsItem->getRowTax());
171171
$this->assertEquals(self::PRICE_INCL_TAX, $this->taxDetailsItem->getPriceInclTax());
172172
}
173173

app/code/Magento/Theme/view/adminhtml/requirejs-config.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@ var config = {
8888
'mage/backend/bootstrap',
8989
'mage/adminhtml/globals'
9090
],
91-
config: {
92-
mixins: {
93-
'jquery/jquery-ui': {
94-
'jquery/patches/jquery-ui-sortable': true
95-
}
96-
}
97-
},
9891
'paths': {
9992
'jquery/ui': 'jquery/jquery-ui'
10093
}

app/code/Magento/Theme/view/frontend/requirejs-config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ var config = {
4040
mixins: {
4141
'Magento_Theme/js/view/breadcrumbs': {
4242
'Magento_Theme/js/view/add-home-breadcrumb': true
43-
},
44-
'jquery/ui-modules/widgets/sortable': {
45-
'jquery/patches/jquery-ui-sortable': true
4643
}
4744
}
4845
}

app/design/frontend/Magento/blank/etc/view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
<item type="file">Lib::chartjs/Chart.min.js</item>
263263
<item type="file">Lib::chartjs/chartjs-adapter-moment.js</item>
264264
<item type="file">Lib::jquery/jquery.min.js</item>
265-
<item type="file">Lib::jquery/jquery-ui-1.9.2.js</item>
265+
<item type="file">Lib::jquery/jquery-ui.js</item>
266266
<item type="file">Lib::jquery/colorpicker/js/colorpicker.js</item>
267267
<item type="file">Lib::requirejs/require.js</item>
268268
<item type="file">Lib::requirejs/text.js</item>

app/design/frontend/Magento/luma/etc/view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
<item type="file">Lib::chartjs/Chart.min.js</item>
274274
<item type="file">Lib::chartjs/chartjs-adapter-moment.js</item>
275275
<item type="file">Lib::jquery/jquery.min.js</item>
276-
<item type="file">Lib::jquery/jquery-ui-1.9.2.js</item>
276+
<item type="file">Lib::jquery/jquery-ui.js</item>
277277
<item type="file">Lib::jquery/colorpicker/js/colorpicker.js</item>
278278
<item type="file">Lib::requirejs/require.js</item>
279279
<item type="file">Lib::requirejs/text.js</item>

0 commit comments

Comments
 (0)