Skip to content

Commit 2305453

Browse files
Merge pull request #9381 from magento-cia/cia-2.4.8-beta2-develop-2.4-develop-sync-11222024
Cia 2.4.8 beta2 develop 2.4 develop sync 11222024
2 parents 1eebf18 + 6319798 commit 2305453

File tree

3,163 files changed

+45353
-38626
lines changed

Some content is hidden

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

3,163 files changed

+45353
-38626
lines changed

app/code/Magento/AdminAnalytics/Test/Unit/Condition/CanViewNotificationTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67
declare(strict_types=1);
@@ -75,7 +76,7 @@ public function testIsVisibleLoadDataFromLog($expected, $cacheResponse, $logExis
7576
/**
7677
* @return array
7778
*/
78-
public function isVisibleProvider()
79+
public static function isVisibleProvider()
7980
{
8081
return [
8182
[true, false, false],

app/code/Magento/AdminAnalytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~8.1.0||~8.2.0||~8.3.0",
8+
"php": "~8.2.0||~8.3.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-config": "*",

app/code/Magento/AdminNotification/Test/Unit/Model/FeedTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67
declare(strict_types=1);
@@ -217,7 +218,7 @@ function ($initialValue, $item) use ($data) {
217218
/**
218219
* @return array
219220
*/
220-
public function checkUpdateDataProvider(): array
221+
public static function checkUpdateDataProvider(): array
221222
{
222223
return [
223224
[

app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/CacheOutdatedTest.php

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67
declare(strict_types=1);
@@ -60,30 +61,37 @@ protected function setUp(): void
6061
* @param array $cacheTypes
6162
* @dataProvider getIdentityDataProvider
6263
*/
63-
public function testGetIdentity($expectedSum, $cacheTypes)
64+
public function testGetIdentity($expectedSum, $types)
6465
{
66+
$cacheType = [];
67+
foreach ($types as $type) {
68+
$cacheType[] = $type($this);
69+
}
70+
6571
$this->_cacheTypeListMock->method(
6672
'getInvalidated'
6773
)->willReturn(
68-
$cacheTypes
74+
$cacheType
6975
);
7076
$this->assertEquals($expectedSum, $this->_messageModel->getIdentity());
7177
}
7278

73-
/**
74-
* @return array
75-
*/
76-
public function getIdentityDataProvider()
79+
protected function getMockForStdClass($mockReturn)
7780
{
78-
$cacheTypeMock1 = $this->getMockBuilder(\stdClass::class)->addMethods(['getCacheType'])
81+
$cacheTypeMock = $this->getMockBuilder(\stdClass::class)->addMethods(['getCacheType'])
7982
->disableOriginalConstructor()
8083
->getMock();
81-
$cacheTypeMock1->method('getCacheType')->willReturn('Simple');
84+
$cacheTypeMock->method('getCacheType')->willReturn($mockReturn);
85+
return $cacheTypeMock;
86+
}
8287

83-
$cacheTypeMock2 = $this->getMockBuilder(\stdClass::class)->addMethods(['getCacheType'])
84-
->disableOriginalConstructor()
85-
->getMock();
86-
$cacheTypeMock2->method('getCacheType')->willReturn('Advanced');
88+
/**
89+
* @return array
90+
*/
91+
public static function getIdentityDataProvider()
92+
{
93+
$cacheTypeMock1 = static fn (self $testCase) => $testCase->getMockForStdClass('Simple');
94+
$cacheTypeMock2 = static fn (self $testCase) => $testCase->getMockForStdClass('Advanced');
8795

8896
return [
8997
['c13cfaddc2c53e8d32f59bfe89719beb', [$cacheTypeMock1]],
@@ -99,24 +107,25 @@ public function getIdentityDataProvider()
99107
*/
100108
public function testIsDisplayed($expected, $allowed, $cacheTypes)
101109
{
110+
$cacheType1 = [];
111+
foreach ($cacheTypes as $cacheType) {
112+
$cacheType1[] = $cacheType($this);
113+
}
102114
$this->_authorizationMock->expects($this->once())->method('isAllowed')->willReturn($allowed);
103115
$this->_cacheTypeListMock->method(
104116
'getInvalidated'
105117
)->willReturn(
106-
$cacheTypes
118+
$cacheType1
107119
);
108120
$this->assertEquals($expected, $this->_messageModel->isDisplayed());
109121
}
110122

111123
/**
112124
* @return array
113125
*/
114-
public function isDisplayedDataProvider()
126+
public static function isDisplayedDataProvider()
115127
{
116-
$cacheTypesMock = $this->getMockBuilder(\stdClass::class)->addMethods(['getCacheType'])
117-
->disableOriginalConstructor()
118-
->getMock();
119-
$cacheTypesMock->method('getCacheType')->willReturn('someVal');
128+
$cacheTypesMock = static fn (self $testCase) => $testCase->getMockForStdClass('someVal');
120129
$cacheTypes = [$cacheTypesMock, $cacheTypesMock];
121130
return [
122131
[false, false, []],

app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/Media/Synchronization/ErrorTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67
declare(strict_types=1);
@@ -82,7 +83,7 @@ public function testIsDisplayed($expectedFirstRun, $data)
8283
/**
8384
* @return array
8485
*/
85-
public function isDisplayedDataProvider()
86+
public static function isDisplayedDataProvider()
8687
{
8788
return [
8889
[true, ['has_errors' => 1]],

app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/SecurityTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67
declare(strict_types=1);
@@ -85,7 +86,7 @@ public function testIsDisplayed($expectedResult, $cached, $response)
8586
/**
8687
* @return array
8788
*/
88-
public function isDisplayedDataProvider()
89+
public static function isDisplayedDataProvider()
8990
{
9091
return [
9192
'cached_case' => [false, true, ''],

app/code/Magento/AdminNotification/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~8.1.0||~8.2.0||~8.3.0",
8+
"php": "~8.2.0||~8.3.0",
99
"lib-libxml": "*",
1010
"magento/framework": "*",
1111
"magento/module-backend": "*",

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67
declare(strict_types=1);
@@ -203,100 +204,100 @@ public static function isValidResultFalseDataProvider()
203204
return [
204205
// First if condition cases.
205206
[
206-
'$value' => [
207+
'value' => [
207208
AdvancedPricing::COL_TIER_PRICE_WEBSITE => null,
208209
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
209210
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
210211
AdvancedPricing::COL_TIER_PRICE => 1000,
211212
],
212-
'$hasEmptyColumns' => null,
213-
'$customerGroups' => [
213+
'hasEmptyColumns' => null,
214+
'customerGroups' => [
214215
'value' => 'value'
215216
],
216217
],
217218
[
218-
'$value' => [
219+
'value' => [
219220
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
220221
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => null,
221222
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
222223
AdvancedPricing::COL_TIER_PRICE => 1000,
223224
],
224-
'$hasEmptyColumns' => null,
225-
'$customerGroups' => [
225+
'hasEmptyColumns' => null,
226+
'customerGroups' => [
226227
'value' => 'value'
227228
],
228229
],
229230
[
230-
'$value' => [
231+
'value' => [
231232
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
232233
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
233234
AdvancedPricing::COL_TIER_PRICE_QTY => null,
234235
AdvancedPricing::COL_TIER_PRICE => 1000,
235236
],
236-
'$hasEmptyColumns' => null,
237-
'$customerGroups' => [
237+
'hasEmptyColumns' => null,
238+
'customerGroups' => [
238239
'value' => 'value'
239240
],
240241
],
241242
[
242-
'$value' => [
243+
'value' => [
243244
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
244245
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
245246
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
246247
AdvancedPricing::COL_TIER_PRICE => null,
247248
],
248-
'$hasEmptyColumns' => null,
249-
'$customerGroups' => [
249+
'hasEmptyColumns' => null,
250+
'customerGroups' => [
250251
'value' => 'value'
251252
],
252253
],
253254
[
254-
'$value' => [
255+
'value' => [
255256
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
256257
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
257258
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
258259
AdvancedPricing::COL_TIER_PRICE => 1000,
259260
],
260-
'$hasEmptyColumns' => true,
261-
'$customerGroups' => [
261+
'hasEmptyColumns' => true,
262+
'customerGroups' => [
262263
'value' => 'value'
263264
],
264265
],
265266
// Second if condition cases.
266267
[
267-
'$value' => [
268+
'value' => [
268269
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
269270
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'not ALL GROUPS',
270271
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
271272
AdvancedPricing::COL_TIER_PRICE => 1000,
272273
],
273-
'$hasEmptyColumns' => null,
274-
'$customerGroups' => [
274+
'hasEmptyColumns' => null,
275+
'customerGroups' => [
275276
'value' => 'value'
276277
],
277278
],
278279
// Third if condition cases.
279280
[
280-
'$value' => [
281+
'value' => [
281282
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
282283
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
283284
AdvancedPricing::COL_TIER_PRICE_QTY => -1000,
284285
AdvancedPricing::COL_TIER_PRICE => 1000,
285286
],
286-
'$hasEmptyColumns' => null,
287-
'$customerGroups' => [
287+
'hasEmptyColumns' => null,
288+
'customerGroups' => [
288289
'value' => 'value'
289290
],
290291
],
291292
[
292-
'$value' => [
293+
'value' => [
293294
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
294295
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
295296
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
296297
AdvancedPricing::COL_TIER_PRICE => -1000,
297298
],
298-
'$hasEmptyColumns' => null,
299-
'$customerGroups' => [
299+
'hasEmptyColumns' => null,
300+
'customerGroups' => [
300301
'value' => 'value'
301302
],
302303
],
@@ -311,45 +312,45 @@ public static function isValidAddMessagesCallDataProvider()
311312
return [
312313
// First if condition cases.
313314
[
314-
'$value' => [
315+
'value' => [
315316
AdvancedPricing::COL_TIER_PRICE_WEBSITE => null,
316317
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
317318
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
318319
AdvancedPricing::COL_TIER_PRICE => 1000,
319320
],
320-
'$hasEmptyColumns' => null,
321-
'$customerGroups' => [
321+
'hasEmptyColumns' => null,
322+
'customerGroups' => [
322323
'value' => 'value'
323324
],
324-
'$expectedMessages' => [Validator::ERROR_TIER_DATA_INCOMPLETE],
325+
'expectedMessages' => [Validator::ERROR_TIER_DATA_INCOMPLETE],
325326
],
326327
// Second if condition cases.
327328
[
328-
'$value' => [
329+
'value' => [
329330
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
330331
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'not ALL GROUPS',
331332
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
332333
AdvancedPricing::COL_TIER_PRICE => 1000,
333334
],
334-
'$hasEmptyColumns' => null,
335-
'$customerGroups' => [
335+
'hasEmptyColumns' => null,
336+
'customerGroups' => [
336337
'value' => 'value'
337338
],
338-
'$expectedMessages' => [Validator::ERROR_INVALID_TIER_PRICE_GROUP],
339+
'expectedMessages' => [Validator::ERROR_INVALID_TIER_PRICE_GROUP],
339340
],
340341
// Third if condition cases.
341342
[
342-
'$value' => [
343+
'value' => [
343344
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
344345
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
345346
AdvancedPricing::COL_TIER_PRICE_QTY => -1000,
346347
AdvancedPricing::COL_TIER_PRICE => 1000,
347348
],
348-
'$hasEmptyColumns' => null,
349-
'$customerGroups' => [
349+
'hasEmptyColumns' => null,
350+
'customerGroups' => [
350351
'value' => 'value'
351352
],
352-
'$expectedMessages' => [Validator::ERROR_INVALID_TIER_PRICE_QTY],
353+
'expectedMessages' => [Validator::ERROR_INVALID_TIER_PRICE_QTY],
353354
],
354355
];
355356
}

0 commit comments

Comments
 (0)