Skip to content

Commit 01aeae6

Browse files
authored
Merge branch '2.4-develop' into Fixed-27141
2 parents c85bcd0 + bb7e08f commit 01aeae6

File tree

3,485 files changed

+65454
-80039
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,485 files changed

+65454
-80039
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ If you are a new GitHub user, we recommend that you create your own [free github
3131
This will allow you to collaborate with the Magento 2 development team, fork the Magento 2 project and send pull requests.
3232

3333
1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
34-
2. Review the [Contributor License Agreement](https://magento.com/legaldocuments/mca) if this is your first time contributing.
34+
2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing.
3535
3. Create and test your work.
3636
4. Fork the Magento 2 repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#pull_request).
3737
5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed.

app/code/Magento/AdminAnalytics/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/code/Magento/AdminAnalytics/Test/Mftf/Test/TrackingScriptTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
</annotations>
2222

2323
<!-- Logging in Magento admin -->
24-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2525
</test>
2626
</tests>

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,27 @@
1111
use Magento\Framework\App\ProductMetadataInterface;
1212
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1313
use Magento\Framework\App\CacheInterface;
14+
use PHPUnit\Framework\MockObject\MockObject;
15+
use PHPUnit\Framework\TestCase;
1416

15-
/**
16-
* Class CanViewNotificationTest
17-
*/
18-
class CanViewNotificationTest extends \PHPUnit\Framework\TestCase
17+
class CanViewNotificationTest extends TestCase
1918
{
2019
/** @var CanViewNotification */
2120
private $canViewNotification;
2221

23-
/** @var Logger|\PHPUnit_Framework_MockObject_MockObject */
22+
/** @var Logger|MockObject */
2423
private $viewerLoggerMock;
2524

26-
/** @var ProductMetadataInterface|\PHPUnit_Framework_MockObject_MockObject */
25+
/** @var ProductMetadataInterface|MockObject */
2726
private $productMetadataMock;
2827

29-
/** @var Log|\PHPUnit_Framework_MockObject_MockObject */
28+
/** @var Log|MockObject */
3029
private $logMock;
3130

32-
/** @var $cacheStorageMock \PHPUnit_Framework_MockObject_MockObject|CacheInterface */
31+
/** @var $cacheStorageMock MockObject|CacheInterface */
3332
private $cacheStorageMock;
3433

35-
public function setUp()
34+
protected function setUp(): void
3635
{
3736
$this->cacheStorageMock = $this->getMockBuilder(CacheInterface::class)
3837
->getMockForAbstractClass();

app/code/Magento/AdminNotification/Test/Mftf/Test/AdminSystemNotificationNavigateMenuTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<group value="mtf_migrated"/>
2121
</annotations>
2222
<before>
23-
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
2424
</before>
2525
<after>
2626
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>

app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/ActionsTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Magento\Framework\Escaper;
1919
use Magento\Framework\Url\Helper\Data;
2020
use Magento\Framework\UrlInterface;
21+
use PHPUnit\Framework\MockObject\MockObject;
2122
use PHPUnit\Framework\TestCase;
2223

2324
class ActionsTest extends TestCase
@@ -32,20 +33,20 @@ protected function setUp() : void
3233
{
3334
parent::setUp();
3435

35-
/** @var Escaper | \PHPUnit_Framework_MockObject_MockObject $escaperMock */
36+
/** @var Escaper|MockObject $escaperMock */
3637
$escaperMock = $this->getMockBuilder(Escaper::class)->disableOriginalConstructor()->getMock();
3738
$escaperMock->expects($this->once())->method('escapeUrl')->willReturn('https://magento.com');
3839

39-
/** @var UrlInterface | \PHPUnit_Framework_MockObject_MockObject $urlBuilder */
40+
/** @var UrlInterface|MockObject $urlBuilder */
4041
$urlBuilder = $this->getMockBuilder(UrlInterface::class)->getMock();
4142
$urlBuilder->expects($this->once())->method('getUrl')->willReturn('http://magento.com');
4243

43-
/** @var Context | \PHPUnit_Framework_MockObject_MockObject $contextMock */
44+
/** @var Context|MockObject $contextMock */
4445
$contextMock = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
4546
$contextMock->expects($this->once())->method('getEscaper')->willReturn($escaperMock);
4647
$contextMock->expects($this->once())->method('getUrlBuilder')->willReturn($urlBuilder);
4748

48-
/** @var Data | \PHPUnit_Framework_MockObject_MockObject $urlHelperMock */
49+
/** @var Data|MockObject $urlHelperMock */
4950
$urlHelperMock = $this->getMockBuilder(Data::class)->disableOriginalConstructor()->getMock();
5051
$urlHelperMock->expects($this->once())->method('getEncodedUrl')->willReturn('http://magento.com');
5152

app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/NoticeTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Magento\Framework\DataObject;
1616
use Magento\Framework\Escaper;
1717
use Magento\Backend\Block\Context;
18+
use PHPUnit\Framework\MockObject\MockObject;
1819
use PHPUnit\Framework\TestCase;
1920

2021
class NoticeTest extends TestCase
@@ -30,11 +31,11 @@ protected function setUp() : void
3031
{
3132
parent::setUp();
3233

33-
/** @var Escaper | \PHPUnit_Framework_MockObject_MockObject $escaperMock */
34+
/** @var Escaper|MockObject $escaperMock */
3435
$escaperMock = $this->getMockBuilder(Escaper::class)->disableOriginalConstructor()->getMock();
3536
$escaperMock->expects($this->exactly(2))->method('escapeHtml')->willReturn('<div>Some random html</div>');
3637

37-
/** @var Context | \PHPUnit_Framework_MockObject_MockObject $contextMock */
38+
/** @var Context|MockObject $contextMock */
3839
$contextMock = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
3940
$contextMock->expects($this->once())->method('getEscaper')->willReturn($escaperMock);
4041

app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Magento\Backend\Block\Widget\Grid\Column;
1818
use Magento\Framework\DataObject;
1919
use Magento\Framework\Escaper;
20+
use PHPUnit\Framework\MockObject\MockObject;
2021
use PHPUnit\Framework\TestCase;
2122

2223
class SeverityTest extends TestCase
@@ -32,18 +33,18 @@ protected function setUp() : void
3233
{
3334
parent::setUp();
3435

35-
/** @var Inbox |\PHPUnit_Framework_MockObject_MockObject $inboxMock */
36+
/** @var Inbox|MockObject $inboxMock */
3637
$inboxMock = $this->getMockBuilder(Inbox::class)->disableOriginalConstructor()->getMock();
3738

38-
/** @var Context | \PHPUnit_Framework_MockObject_MockObject $contextMock */
39+
/** @var Context|MockObject $contextMock */
3940
$contextMock = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
4041

4142
$this->sut = new Severity($contextMock, $inboxMock);
4243
}
4344

4445
public function testShouldRenderSeverity() : void
4546
{
46-
/** @var Column | \PHPUnit_Framework_MockObject_MockObject $columnMock */
47+
/** @var Column|MockObject $columnMock */
4748
$columnMock = $this->getMockBuilder(Column::class)
4849
->disableOriginalConstructor()
4950
->setMethods(['getIndex'])

app/code/Magento/AdminNotification/Test/Unit/Block/ToolbarEntryTest.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,31 @@
99
*/
1010
namespace Magento\AdminNotification\Test\Unit\Block;
1111

12-
class ToolbarEntryTest extends \PHPUnit\Framework\TestCase
12+
use Magento\AdminNotification\Block\ToolbarEntry;
13+
use Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread;
14+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
15+
use PHPUnit\Framework\TestCase;
16+
17+
class ToolbarEntryTest extends TestCase
1318
{
1419
/**
1520
* Retrieve toolbar entry block instance
1621
*
1722
* @param int $unreadNotifications number of unread notifications
18-
* @return \Magento\AdminNotification\Block\ToolbarEntry
23+
* @return ToolbarEntry
1924
*/
2025
protected function _getBlockInstance($unreadNotifications)
2126
{
22-
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
27+
$objectManagerHelper = new ObjectManager($this);
2328
// mock collection of unread notifications
2429
$notificationList = $this->createPartialMock(
25-
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class,
30+
Unread::class,
2631
['getSize', 'setCurPage', 'setPageSize']
2732
);
2833
$notificationList->expects($this->any())->method('getSize')->will($this->returnValue($unreadNotifications));
2934

3035
$block = $objectManagerHelper->getObject(
31-
\Magento\AdminNotification\Block\ToolbarEntry::class,
36+
ToolbarEntry::class,
3237
['notificationList' => $notificationList]
3338
);
3439

@@ -44,25 +49,23 @@ public function testGetUnreadNotificationCount()
4449

4550
public function testGetLatestUnreadNotifications()
4651
{
47-
$helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
52+
$helper = new ObjectManager($this);
4853

4954
// 1. Create mocks
50-
$notificationList = $this->getMockBuilder(
51-
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class
52-
)
55+
$notificationList = $this->getMockBuilder(Unread::class)
5356
->disableOriginalConstructor()
5457
->getMock();
5558

56-
/** @var \Magento\AdminNotification\Block\ToolbarEntry $model */
59+
/** @var ToolbarEntry $model */
5760
$model = $helper->getObject(
58-
\Magento\AdminNotification\Block\ToolbarEntry::class,
61+
ToolbarEntry::class,
5962
['notificationList' => $notificationList]
6063
);
6164

6265
// 2. Set expectations
6366
$notificationList->expects($this->atLeastOnce())
6467
->method('setPageSize')
65-
->with(\Magento\AdminNotification\Block\ToolbarEntry::NOTIFICATIONS_NUMBER)
68+
->with(ToolbarEntry::NOTIFICATIONS_NUMBER)
6669
->will($this->returnSelf());
6770

6871
// 3. Run tested method

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

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,74 +6,87 @@
66

77
namespace Magento\AdminNotification\Test\Unit\Model;
88

9+
use Magento\AdminNotification\Model\Feed;
10+
use Magento\AdminNotification\Model\Inbox;
11+
use Magento\AdminNotification\Model\InboxFactory;
12+
use Magento\Backend\App\ConfigInterface;
13+
use Magento\Framework\App\CacheInterface;
14+
use Magento\Framework\App\DeploymentConfig;
15+
use Magento\Framework\App\ProductMetadata;
16+
use Magento\Framework\App\State;
917
use Magento\Framework\Config\ConfigOptionsListConstants;
18+
use Magento\Framework\HTTP\Adapter\Curl;
19+
use Magento\Framework\HTTP\Adapter\CurlFactory;
1020
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
21+
use Magento\Framework\UrlInterface;
22+
use PHPUnit\Framework\MockObject\MockObject;
23+
use PHPUnit\Framework\TestCase;
1124

1225
/**
1326
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1427
*/
15-
class FeedTest extends \PHPUnit\Framework\TestCase
28+
class FeedTest extends TestCase
1629
{
17-
/** @var \Magento\AdminNotification\Model\Feed */
30+
/** @var Feed */
1831
protected $feed;
1932

2033
/** @var ObjectManagerHelper */
2134
protected $objectManagerHelper;
2235

23-
/** @var \Magento\AdminNotification\Model\InboxFactory|\PHPUnit_Framework_MockObject_MockObject */
36+
/** @var InboxFactory|MockObject */
2437
protected $inboxFactory;
2538

26-
/** @var \Magento\AdminNotification\Model\Inbox|\PHPUnit_Framework_MockObject_MockObject */
39+
/** @var Inbox|MockObject */
2740
protected $inboxModel;
2841

29-
/** @var \Magento\Framework\HTTP\Adapter\CurlFactory|\PHPUnit_Framework_MockObject_MockObject */
42+
/** @var CurlFactory|MockObject */
3043
protected $curlFactory;
3144

32-
/** @var \Magento\Framework\HTTP\Adapter\Curl|\PHPUnit_Framework_MockObject_MockObject */
45+
/** @var Curl|MockObject */
3346
protected $curl;
3447

35-
/** @var \Magento\Backend\App\ConfigInterface|\PHPUnit_Framework_MockObject_MockObject */
48+
/** @var ConfigInterface|MockObject */
3649
protected $backendConfig;
3750

38-
/** @var \Magento\Framework\App\CacheInterface|\PHPUnit_Framework_MockObject_MockObject */
51+
/** @var CacheInterface|MockObject */
3952
protected $cacheManager;
4053

41-
/** @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject */
54+
/** @var State|MockObject */
4255
protected $appState;
4356

44-
/** @var \Magento\Framework\App\DeploymentConfig|\PHPUnit_Framework_MockObject_MockObject */
57+
/** @var DeploymentConfig|MockObject */
4558
protected $deploymentConfig;
4659

47-
/** @var \Magento\Framework\App\ProductMetadata|\PHPUnit_Framework_MockObject_MockObject */
60+
/** @var ProductMetadata|MockObject */
4861
protected $productMetadata;
4962

50-
/** @var \Magento\Framework\UrlInterface|\PHPUnit_Framework_MockObject_MockObject */
63+
/** @var UrlInterface|MockObject */
5164
protected $urlBuilder;
5265

53-
protected function setUp()
66+
protected function setUp(): void
5467
{
5568
$this->inboxFactory = $this->createPartialMock(
56-
\Magento\AdminNotification\Model\InboxFactory::class,
69+
InboxFactory::class,
5770
['create']
5871
);
59-
$this->curlFactory = $this->createPartialMock(\Magento\Framework\HTTP\Adapter\CurlFactory::class, ['create']);
60-
$this->curl = $this->getMockBuilder(\Magento\Framework\HTTP\Adapter\Curl::class)
72+
$this->curlFactory = $this->createPartialMock(CurlFactory::class, ['create']);
73+
$this->curl = $this->getMockBuilder(Curl::class)
6174
->disableOriginalConstructor()->getMock();
62-
$this->appState = $this->createPartialMock(\Magento\Framework\App\State::class, ['getInstallDate']);
63-
$this->inboxModel = $this->createPartialMock(\Magento\AdminNotification\Model\Inbox::class, [
75+
$this->appState = $this->createPartialMock(State::class, []);
76+
$this->inboxModel = $this->createPartialMock(Inbox::class, [
6477
'__wakeup',
6578
'parse'
6679
]);
6780
$this->backendConfig = $this->createPartialMock(
68-
\Magento\Backend\App\ConfigInterface::class,
81+
ConfigInterface::class,
6982
[
7083
'getValue',
7184
'setValue',
7285
'isSetFlag'
7386
]
7487
);
7588
$this->cacheManager = $this->createPartialMock(
76-
\Magento\Framework\App\CacheInterface::class,
89+
CacheInterface::class,
7790
[
7891
'load',
7992
'getFrontend',
@@ -83,18 +96,18 @@ protected function setUp()
8396
]
8497
);
8598

86-
$this->deploymentConfig = $this->getMockBuilder(\Magento\Framework\App\DeploymentConfig::class)
99+
$this->deploymentConfig = $this->getMockBuilder(DeploymentConfig::class)
87100
->disableOriginalConstructor()->getMock();
88101

89102
$this->objectManagerHelper = new ObjectManagerHelper($this);
90103

91-
$this->productMetadata = $this->getMockBuilder(\Magento\Framework\App\ProductMetadata::class)
104+
$this->productMetadata = $this->getMockBuilder(ProductMetadata::class)
92105
->disableOriginalConstructor()->getMock();
93106

94-
$this->urlBuilder = $this->createMock(\Magento\Framework\UrlInterface::class);
107+
$this->urlBuilder = $this->createMock(UrlInterface::class);
95108

96109
$this->feed = $this->objectManagerHelper->getObject(
97-
\Magento\AdminNotification\Model\Feed::class,
110+
Feed::class,
98111
[
99112
'backendConfig' => $this->backendConfig,
100113
'cacheManager' => $this->cacheManager,

0 commit comments

Comments
 (0)