Skip to content

Commit 38514c7

Browse files
authored
Merge branch '2.4.8-develop' into AC-12733
2 parents 316fab6 + a430861 commit 38514c7

File tree

5,181 files changed

+55895
-47105
lines changed

Some content is hidden

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

5,181 files changed

+55895
-47105
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/ViewModel/Metadata.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2019 Adobe
4+
* All Rights Reserved.
55
*/
66

77
declare(strict_types=1);
@@ -65,7 +65,7 @@ public function __construct(
6565
Session $authSession,
6666
State $appState,
6767
ScopeConfigInterface $config,
68-
CspNonceProvider $nonceProvider = null
68+
?CspNonceProvider $nonceProvider = null
6969
) {
7070
$this->productMetadata = $productMetadata;
7171
$this->authSession = $authSession;

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||~8.4.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-config": "*",

app/code/Magento/AdminNotification/Model/Feed.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2011 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\AdminNotification\Model;
77

@@ -107,10 +107,10 @@ public function __construct(
107107
DeploymentConfig $deploymentConfig,
108108
ProductMetadataInterface $productMetadata,
109109
UrlInterface $urlBuilder,
110-
AbstractResource $resource = null,
111-
AbstractDb $resourceCollection = null,
110+
?AbstractResource $resource = null,
111+
?AbstractDb $resourceCollection = null,
112112
array $data = [],
113-
Escaper $escaper = null
113+
?Escaper $escaper = null
114114
) {
115115
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
116116
$this->_backendConfig = $backendConfig;

app/code/Magento/AdminNotification/Model/ResourceModel/System/Message/Collection.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2013 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\AdminNotification\Model\ResourceModel\System\Message;
77

@@ -40,8 +40,8 @@ public function __construct(
4040
\Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
4141
\Magento\Framework\Event\ManagerInterface $eventManager,
4242
\Magento\Framework\Notification\MessageList $messageList,
43-
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
44-
\Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
43+
?\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
44+
?\Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
4545
) {
4646
$this->_messageList = $messageList;
4747
parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);

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||~8.4.0",
99
"lib-libxml": "*",
1010
"magento/framework": "*",
1111
"magento/module-backend": "*",

0 commit comments

Comments
 (0)