Skip to content

Commit 5a5fa68

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into Arrows-AC-15503
2 parents ebf2112 + 0a3b703 commit 5a5fa68

File tree

12,336 files changed

+41710
-39687
lines changed

Some content is hidden

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

12,336 files changed

+41710
-39687
lines changed

.php-cs-fixer.dist.php

Lines changed: 2 additions & 2 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 2021 Adobe
4+
* All Rights Reserved.
55
*/
66

77
/**

Gruntfile.js.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2014 Adobe
3+
* All Rights Reserved.
44
*/
55

66
// For performance use one level down: 'name/{,*/}*.js'

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ We encourage experts from the Community to help us with GitHub routines such as
4141
- [Learn more about the Maintainer role](https://developer.adobe.com/commerce/contributor/guides/maintainers/)
4242
- [Maintainer's Handbook](https://developer.adobe.com/commerce/contributor/guides/maintainers/handbook/)
4343

44-
[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png)](https://magento.com/magento-contributors#maintainers)
44+
[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png)](https://developer.adobe.com/commerce/contributor/guides/maintainers/)
4545

4646
### Leaders
4747

48-
Adobe highly appreciates contributions that help us to improve the code, clarify the documentation, and increase test coverage. Check out our Community leaders, superstars, and superheroes on the [leaderboard](https://magento.biterg.io/app/kibana#/dashboard/41dc0c60-fa06-11eb-bbaa-dd6ca6f8fda8?_g=()).
48+
Adobe highly appreciates contributions that help us to improve the code, clarify the documentation, and increase test coverage. Check out our Community leaders, superstars, and superheroes on the [leaderboard](https://github.com/magento/magento2/graphs/contributors).
4949

50-
[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png)](https://magento.com/magento-contributors)
50+
[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png)](https://github.com/magento/magento2/graphs/contributors)
5151

5252
### Labeling
5353

app/autoload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/**
33
* Register basic autoloader that uses include path
44
*
5-
* Copyright © Magento, Inc. All rights reserved.
6-
* See COPYING.txt for license details.
5+
* Copyright 2012 Adobe
6+
* All Rights Reserved.
77
*/
88
declare(strict_types=1);
99

app/bootstrap.php

Lines changed: 2 additions & 2 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

77
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ protected function setUp(): void
3939
$escaperMock->expects($this->atLeastOnce())->method('escapeUrl')->willReturn('https://magento.com');
4040

4141
/** @var AuthorizationInterface|MockObject $authorizationMock */
42-
$authorizationMock = $this->getMockForAbstractClass(AuthorizationInterface::class);
42+
$authorizationMock = $this->createMock(AuthorizationInterface::class);
4343
$authorizationMock->expects($this->atLeastOnce())
4444
->method('isAllowed')
4545
->willReturn(true);
4646

4747
/** @var UrlInterface|MockObject $urlBuilder */
48-
$urlBuilder = $this->getMockForAbstractClass(UrlInterface::class);
48+
$urlBuilder = $this->createMock(UrlInterface::class);
4949
$urlBuilder->expects($this->once())->method('getUrl')->willReturn('http://magento.com');
5050

5151
/** @var Context|MockObject $contextMock */

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
use Magento\Backend\Block\Context;
1717
use Magento\Backend\Block\Widget\Grid\Column;
1818
use Magento\Framework\DataObject;
19+
use Magento\Framework\TestFramework\Unit\Helper\MockCreationTrait;
1920
use PHPUnit\Framework\MockObject\MockObject;
2021
use PHPUnit\Framework\TestCase;
2122

2223
class SeverityTest extends TestCase
2324
{
25+
use MockCreationTrait;
26+
2427
/**
2528
* System under Test
2629
*
@@ -44,10 +47,7 @@ protected function setUp(): void
4447
public function testShouldRenderSeverity() : void
4548
{
4649
/** @var Column|MockObject $columnMock */
47-
$columnMock = $this->getMockBuilder(Column::class)
48-
->disableOriginalConstructor()
49-
->addMethods(['getIndex'])
50-
->getMock();
50+
$columnMock = $this->createPartialMockWithReflection(Column::class, ['getIndex']);
5151
$columnMock->expects($this->exactly(5))->method('getIndex')->willReturn('index');
5252
$this->sut->setColumn($columnMock);
5353
$dataObject = new DataObject();

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Magento\Framework\HTTP\Adapter\CurlFactory;
2121
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
2222
use Magento\Framework\UrlInterface;
23+
use PHPUnit\Framework\Attributes\DataProvider;
2324
use PHPUnit\Framework\MockObject\MockObject;
2425
use PHPUnit\Framework\TestCase;
2526

@@ -100,10 +101,7 @@ protected function setUp(): void
100101
$this->curlFactory = $this->createPartialMock(CurlFactory::class, ['create']);
101102
$this->curl = $this->createMock(Curl::class);
102103
$this->appState = $this->createPartialMock(State::class, []);
103-
$this->inboxModel = $this->createPartialMock(Inbox::class, [
104-
'__wakeup',
105-
'parse'
106-
]);
104+
$this->inboxModel = $this->createMock(Inbox::class);
107105
$this->backendConfig = $this->createPartialMock(
108106
ConfigInterface::class,
109107
[
@@ -126,7 +124,7 @@ protected function setUp(): void
126124
$this->deploymentConfig = $this->createMock(DeploymentConfig::class);
127125
$this->objectManagerHelper = new ObjectManagerHelper($this);
128126
$this->productMetadata = $this->createMock(ProductMetadata::class);
129-
$this->urlBuilder = $this->getMockForAbstractClass(UrlInterface::class);
127+
$this->urlBuilder = $this->createMock(UrlInterface::class);
130128

131129
$this->feed = $this->objectManagerHelper->getObject(
132130
Feed::class,
@@ -148,8 +146,8 @@ protected function setUp(): void
148146
* @param string $curlRequest
149147
*
150148
* @return void
151-
* @dataProvider checkUpdateDataProvider
152149
*/
150+
#[DataProvider('checkUpdateDataProvider')]
153151
public function testCheckUpdate(bool $callInbox, string $curlRequest): void
154152
{
155153
$mockName = 'Test Product Name';

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
use Magento\AdminNotification\Model\InboxFactory;
1515
use Magento\AdminNotification\Model\NotificationService;
1616
use Magento\Framework\Exception\LocalizedException;
17+
use Magento\Framework\TestFramework\Unit\Helper\MockCreationTrait;
1718
use PHPUnit\Framework\MockObject\MockObject;
1819
use PHPUnit\Framework\TestCase;
1920

2021
class NotificationServiceTest extends TestCase
2122
{
23+
use MockCreationTrait;
24+
2225
/**
2326
* Retrieve instance of notification service model
2427
*
@@ -30,15 +33,11 @@ protected function _getServiceInstanceForMarkAsReadTest($notificationId)
3033
/**
3134
* @var MockObject|InboxFactory $notificationFactory
3235
*/
33-
$notificationFactory = $this->createPartialMock(
34-
InboxFactory::class,
35-
['create']
36+
$notificationFactory = $this->createMock(InboxFactory::class);
37+
$notification = $this->createPartialMockWithReflection(
38+
Inbox::class,
39+
['load', 'getId', 'save', 'setData', 'setIsRead']
3640
);
37-
$notification = $this->getMockBuilder(Inbox::class)
38-
->addMethods(['setIsRead'])
39-
->onlyMethods(['load', 'getId', 'save', 'setData', '__sleep', '__wakeup'])
40-
->disableOriginalConstructor()
41-
->getMock();
4241
$notification->expects($this->once())->method('load')->with($notificationId)->willReturnSelf();
4342
$notification->expects($this->once())->method('getId')->willReturn($notificationId);
4443

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010
use Magento\AdminNotification\Model\System\Message\CacheOutdated;
1111
use Magento\Framework\App\Cache\TypeListInterface;
1212
use Magento\Framework\AuthorizationInterface;
13+
use Magento\Framework\TestFramework\Unit\Helper\MockCreationTrait;
1314
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1415
use Magento\Framework\UrlInterface;
16+
use PHPUnit\Framework\Attributes\DataProvider;
1517
use PHPUnit\Framework\MockObject\MockObject;
1618
use PHPUnit\Framework\TestCase;
1719

1820
class CacheOutdatedTest extends TestCase
1921
{
22+
use MockCreationTrait;
23+
2024
/**
2125
* @var MockObject
2226
*/
@@ -39,9 +43,9 @@ class CacheOutdatedTest extends TestCase
3943

4044
protected function setUp(): void
4145
{
42-
$this->_authorizationMock = $this->getMockForAbstractClass(AuthorizationInterface::class);
43-
$this->_urlInterfaceMock = $this->getMockForAbstractClass(UrlInterface::class);
44-
$this->_cacheTypeListMock = $this->getMockForAbstractClass(TypeListInterface::class);
46+
$this->_authorizationMock = $this->createMock(AuthorizationInterface::class);
47+
$this->_urlInterfaceMock = $this->createMock(UrlInterface::class);
48+
$this->_cacheTypeListMock = $this->createMock(TypeListInterface::class);
4549

4650
$objectManagerHelper = new ObjectManager($this);
4751
$arguments = [
@@ -58,8 +62,8 @@ protected function setUp(): void
5862
/**
5963
* @param string $expectedSum
6064
* @param array $cacheTypes
61-
* @dataProvider getIdentityDataProvider
6265
*/
66+
#[DataProvider('getIdentityDataProvider')]
6367
public function testGetIdentity($expectedSum, $types)
6468
{
6569
$cacheType = [];
@@ -77,9 +81,7 @@ public function testGetIdentity($expectedSum, $types)
7781

7882
protected function getMockForStdClass($mockReturn)
7983
{
80-
$cacheTypeMock = $this->getMockBuilder(\stdClass::class)->addMethods(['getCacheType'])
81-
->disableOriginalConstructor()
82-
->getMock();
84+
$cacheTypeMock = $this->createPartialMockWithReflection(\stdClass::class, ['getCacheType']);
8385
$cacheTypeMock->method('getCacheType')->willReturn($mockReturn);
8486
return $cacheTypeMock;
8587
}
@@ -102,8 +104,8 @@ public static function getIdentityDataProvider()
102104
* @param bool $expected
103105
* @param bool $allowed
104106
* @param array $cacheTypes
105-
* @dataProvider isDisplayedDataProvider
106107
*/
108+
#[DataProvider('isDisplayedDataProvider')]
107109
public function testIsDisplayed($expected, $allowed, $cacheTypes)
108110
{
109111
$cacheType1 = [];

0 commit comments

Comments
 (0)