Skip to content

Commit 28edd56

Browse files
committed
Merge branch '2.4-develop' of https://github.com/adobe-commerce-tier-4/magento2ce into ACP2E-3255
2 parents a80ffe8 + 249c371 commit 28edd56

File tree

1,905 files changed

+9396
-8196
lines changed

Some content is hidden

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

1,905 files changed

+9396
-8196
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function testIsVisibleLoadDataFromLog($expected, $cacheResponse, $logExis
7575
/**
7676
* @return array
7777
*/
78-
public function isVisibleProvider()
78+
public static function isVisibleProvider()
7979
{
8080
return [
8181
[true, false, false],

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function ($initialValue, $item) use ($data) {
217217
/**
218218
* @return array
219219
*/
220-
public function checkUpdateDataProvider(): array
220+
public static function checkUpdateDataProvider(): array
221221
{
222222
return [
223223
[

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

+26-18
Original file line numberDiff line numberDiff line change
@@ -60,30 +60,37 @@ protected function setUp(): void
6060
* @param array $cacheTypes
6161
* @dataProvider getIdentityDataProvider
6262
*/
63-
public function testGetIdentity($expectedSum, $cacheTypes)
63+
public function testGetIdentity($expectedSum, $types)
6464
{
65+
$cacheType = [];
66+
foreach ($types as $type) {
67+
$cacheType[] = $type($this);
68+
}
69+
6570
$this->_cacheTypeListMock->method(
6671
'getInvalidated'
6772
)->willReturn(
68-
$cacheTypes
73+
$cacheType
6974
);
7075
$this->assertEquals($expectedSum, $this->_messageModel->getIdentity());
7176
}
7277

73-
/**
74-
* @return array
75-
*/
76-
public function getIdentityDataProvider()
78+
protected function getMockForStdClass($mockReturn)
7779
{
78-
$cacheTypeMock1 = $this->getMockBuilder(\stdClass::class)->addMethods(['getCacheType'])
80+
$cacheTypeMock = $this->getMockBuilder(\stdClass::class)->addMethods(['getCacheType'])
7981
->disableOriginalConstructor()
8082
->getMock();
81-
$cacheTypeMock1->method('getCacheType')->willReturn('Simple');
83+
$cacheTypeMock->method('getCacheType')->willReturn($mockReturn);
84+
return $cacheTypeMock;
85+
}
8286

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

8895
return [
8996
['c13cfaddc2c53e8d32f59bfe89719beb', [$cacheTypeMock1]],
@@ -99,24 +106,25 @@ public function getIdentityDataProvider()
99106
*/
100107
public function testIsDisplayed($expected, $allowed, $cacheTypes)
101108
{
109+
$cacheType1 = [];
110+
foreach ($cacheTypes as $cacheType) {
111+
$cacheType1[] = $cacheType($this);
112+
}
102113
$this->_authorizationMock->expects($this->once())->method('isAllowed')->willReturn($allowed);
103114
$this->_cacheTypeListMock->method(
104115
'getInvalidated'
105116
)->willReturn(
106-
$cacheTypes
117+
$cacheType1
107118
);
108119
$this->assertEquals($expected, $this->_messageModel->isDisplayed());
109120
}
110121

111122
/**
112123
* @return array
113124
*/
114-
public function isDisplayedDataProvider()
125+
public static function isDisplayedDataProvider()
115126
{
116-
$cacheTypesMock = $this->getMockBuilder(\stdClass::class)->addMethods(['getCacheType'])
117-
->disableOriginalConstructor()
118-
->getMock();
119-
$cacheTypesMock->method('getCacheType')->willReturn('someVal');
127+
$cacheTypesMock = static fn (self $testCase) => $testCase->getMockForStdClass('someVal');
120128
$cacheTypes = [$cacheTypesMock, $cacheTypesMock];
121129
return [
122130
[false, false, []],

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function testIsDisplayed($expectedFirstRun, $data)
8282
/**
8383
* @return array
8484
*/
85-
public function isDisplayedDataProvider()
85+
public static function isDisplayedDataProvider()
8686
{
8787
return [
8888
[true, ['has_errors' => 1]],

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function testIsDisplayed($expectedResult, $cached, $response)
8585
/**
8686
* @return array
8787
*/
88-
public function isDisplayedDataProvider()
88+
public static function isDisplayedDataProvider()
8989
{
9090
return [
9191
'cached_case' => [false, true, ''],

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

+36-36
Original file line numberDiff line numberDiff line change
@@ -203,100 +203,100 @@ public static function isValidResultFalseDataProvider()
203203
return [
204204
// First if condition cases.
205205
[
206-
'$value' => [
206+
'value' => [
207207
AdvancedPricing::COL_TIER_PRICE_WEBSITE => null,
208208
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
209209
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
210210
AdvancedPricing::COL_TIER_PRICE => 1000,
211211
],
212-
'$hasEmptyColumns' => null,
213-
'$customerGroups' => [
212+
'hasEmptyColumns' => null,
213+
'customerGroups' => [
214214
'value' => 'value'
215215
],
216216
],
217217
[
218-
'$value' => [
218+
'value' => [
219219
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
220220
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => null,
221221
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
222222
AdvancedPricing::COL_TIER_PRICE => 1000,
223223
],
224-
'$hasEmptyColumns' => null,
225-
'$customerGroups' => [
224+
'hasEmptyColumns' => null,
225+
'customerGroups' => [
226226
'value' => 'value'
227227
],
228228
],
229229
[
230-
'$value' => [
230+
'value' => [
231231
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
232232
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
233233
AdvancedPricing::COL_TIER_PRICE_QTY => null,
234234
AdvancedPricing::COL_TIER_PRICE => 1000,
235235
],
236-
'$hasEmptyColumns' => null,
237-
'$customerGroups' => [
236+
'hasEmptyColumns' => null,
237+
'customerGroups' => [
238238
'value' => 'value'
239239
],
240240
],
241241
[
242-
'$value' => [
242+
'value' => [
243243
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
244244
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
245245
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
246246
AdvancedPricing::COL_TIER_PRICE => null,
247247
],
248-
'$hasEmptyColumns' => null,
249-
'$customerGroups' => [
248+
'hasEmptyColumns' => null,
249+
'customerGroups' => [
250250
'value' => 'value'
251251
],
252252
],
253253
[
254-
'$value' => [
254+
'value' => [
255255
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
256256
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
257257
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
258258
AdvancedPricing::COL_TIER_PRICE => 1000,
259259
],
260-
'$hasEmptyColumns' => true,
261-
'$customerGroups' => [
260+
'hasEmptyColumns' => true,
261+
'customerGroups' => [
262262
'value' => 'value'
263263
],
264264
],
265265
// Second if condition cases.
266266
[
267-
'$value' => [
267+
'value' => [
268268
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
269269
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'not ALL GROUPS',
270270
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
271271
AdvancedPricing::COL_TIER_PRICE => 1000,
272272
],
273-
'$hasEmptyColumns' => null,
274-
'$customerGroups' => [
273+
'hasEmptyColumns' => null,
274+
'customerGroups' => [
275275
'value' => 'value'
276276
],
277277
],
278278
// Third if condition cases.
279279
[
280-
'$value' => [
280+
'value' => [
281281
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
282282
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
283283
AdvancedPricing::COL_TIER_PRICE_QTY => -1000,
284284
AdvancedPricing::COL_TIER_PRICE => 1000,
285285
],
286-
'$hasEmptyColumns' => null,
287-
'$customerGroups' => [
286+
'hasEmptyColumns' => null,
287+
'customerGroups' => [
288288
'value' => 'value'
289289
],
290290
],
291291
[
292-
'$value' => [
292+
'value' => [
293293
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
294294
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
295295
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
296296
AdvancedPricing::COL_TIER_PRICE => -1000,
297297
],
298-
'$hasEmptyColumns' => null,
299-
'$customerGroups' => [
298+
'hasEmptyColumns' => null,
299+
'customerGroups' => [
300300
'value' => 'value'
301301
],
302302
],
@@ -311,45 +311,45 @@ public static function isValidAddMessagesCallDataProvider()
311311
return [
312312
// First if condition cases.
313313
[
314-
'$value' => [
314+
'value' => [
315315
AdvancedPricing::COL_TIER_PRICE_WEBSITE => null,
316316
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
317317
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
318318
AdvancedPricing::COL_TIER_PRICE => 1000,
319319
],
320-
'$hasEmptyColumns' => null,
321-
'$customerGroups' => [
320+
'hasEmptyColumns' => null,
321+
'customerGroups' => [
322322
'value' => 'value'
323323
],
324-
'$expectedMessages' => [Validator::ERROR_TIER_DATA_INCOMPLETE],
324+
'expectedMessages' => [Validator::ERROR_TIER_DATA_INCOMPLETE],
325325
],
326326
// Second if condition cases.
327327
[
328-
'$value' => [
328+
'value' => [
329329
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
330330
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'not ALL GROUPS',
331331
AdvancedPricing::COL_TIER_PRICE_QTY => 1000,
332332
AdvancedPricing::COL_TIER_PRICE => 1000,
333333
],
334-
'$hasEmptyColumns' => null,
335-
'$customerGroups' => [
334+
'hasEmptyColumns' => null,
335+
'customerGroups' => [
336336
'value' => 'value'
337337
],
338-
'$expectedMessages' => [Validator::ERROR_INVALID_TIER_PRICE_GROUP],
338+
'expectedMessages' => [Validator::ERROR_INVALID_TIER_PRICE_GROUP],
339339
],
340340
// Third if condition cases.
341341
[
342-
'$value' => [
342+
'value' => [
343343
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'value',
344344
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => 'value',
345345
AdvancedPricing::COL_TIER_PRICE_QTY => -1000,
346346
AdvancedPricing::COL_TIER_PRICE => 1000,
347347
],
348-
'$hasEmptyColumns' => null,
349-
'$customerGroups' => [
348+
'hasEmptyColumns' => null,
349+
'customerGroups' => [
350350
'value' => 'value'
351351
],
352-
'$expectedMessages' => [Validator::ERROR_INVALID_TIER_PRICE_QTY],
352+
'expectedMessages' => [Validator::ERROR_INVALID_TIER_PRICE_QTY],
353353
],
354354
];
355355
}

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

+24-24
Original file line numberDiff line numberDiff line change
@@ -137,55 +137,55 @@ public static function isValidReturnDataProvider()
137137
return [
138138
// False cases.
139139
[
140-
'$value' => [
140+
'value' => [
141141
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'tier value',
142142
AdvancedPricing::COL_TIER_PRICE => 'value',
143143
],
144-
'$allWebsites' => 'not tier|group price website value',
145-
'$colTierPriceWebsite' => false,
146-
'$expectedResult' => false,
144+
'allWebsites' => 'not tier|group price website value',
145+
'colTierPriceWebsite' => false,
146+
'expectedResult' => false,
147147
],
148148
[
149-
'$value' => [
149+
'value' => [
150150
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'tier value',
151151
AdvancedPricing::COL_TIER_PRICE => 'tier value',
152152
],
153-
'$allWebsites' => 'not tier|group price website value',
154-
'$colTierPriceWebsite' => false,
155-
'$expectedResult' => false,
153+
'allWebsites' => 'not tier|group price website value',
154+
'colTierPriceWebsite' => false,
155+
'expectedResult' => false,
156156
],
157157
// True cases.
158158
[
159-
'$value' => [
159+
'value' => [
160160
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'tier value',
161161
],
162-
'$allWebsites' => 'tier value',
163-
'$colTierPriceWebsite' => 'value',
164-
'$expectedResult' => true,
162+
'allWebsites' => 'tier value',
163+
'colTierPriceWebsite' => 'value',
164+
'expectedResult' => true,
165165
],
166166
[
167-
'$value' => [
167+
'value' => [
168168
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'tier value',
169169
],
170-
'$allWebsites' => 'group value',
171-
'$colTierPriceWebsite' => 'value',
172-
'$expectedResult' => true,
170+
'allWebsites' => 'group value',
171+
'colTierPriceWebsite' => 'value',
172+
'expectedResult' => true,
173173
],
174174
[
175-
'$value' => [
175+
'value' => [
176176
AdvancedPricing::COL_TIER_PRICE_WEBSITE => false,
177177
],
178-
'$allWebsites' => 'not tier|group price website value',
179-
'$colTierPriceWebsite' => 'value',
180-
'$expectedResult' => true,
178+
'allWebsites' => 'not tier|group price website value',
179+
'colTierPriceWebsite' => 'value',
180+
'expectedResult' => true,
181181
],
182182
[
183-
'$value' => [
183+
'value' => [
184184
AdvancedPricing::COL_TIER_PRICE_WEBSITE => 'tier value',
185185
],
186-
'$allWebsites' => 'not tier|group price website value',
187-
'$colTierPriceWebsite' => 'value',
188-
'$expectedResult' => true,
186+
'allWebsites' => 'not tier|group price website value',
187+
'colTierPriceWebsite' => 'value',
188+
'expectedResult' => true,
189189
],
190190
];
191191
}

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ public static function isValidDataProvider()
8888
{
8989
return [
9090
[
91-
'$validatorResult' => true,
92-
'$expectedResult' => true,
91+
'validatorResult' => true,
92+
'expectedResult' => true,
9393
],
9494
[
95-
'$validatorResult' => false,
96-
'$expectedResult' => false,
95+
'validatorResult' => false,
96+
'expectedResult' => false,
9797
]
9898
];
9999
}

0 commit comments

Comments
 (0)