Skip to content

Commit 179a72f

Browse files
committed
Merge branch '2.4-develop' of http://github.com/magento/magento2 into fix/admin-category-tree-cache-key
� Conflicts: � app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php
2 parents 06d3e3a + 9fa16c7 commit 179a72f

File tree

10,556 files changed

+206455
-177385
lines changed

Some content is hidden

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

10,556 files changed

+206455
-177385
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.

.travis.yml.sample

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

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: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,43 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\AdminAnalytics\Test\Unit\Condition;
79

810
use Magento\AdminAnalytics\Model\Condition\CanViewNotification;
911
use Magento\AdminAnalytics\Model\ResourceModel\Viewer\Logger;
1012
use Magento\AdminAnalytics\Model\Viewer\Log;
13+
use Magento\Framework\App\CacheInterface;
1114
use Magento\Framework\App\ProductMetadataInterface;
1215
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
13-
use Magento\Framework\App\CacheInterface;
16+
use PHPUnit\Framework\MockObject\MockObject;
17+
use PHPUnit\Framework\TestCase;
1418

15-
/**
16-
* Class CanViewNotificationTest
17-
*/
18-
class CanViewNotificationTest extends \PHPUnit\Framework\TestCase
19+
class CanViewNotificationTest extends TestCase
1920
{
2021
/** @var CanViewNotification */
2122
private $canViewNotification;
2223

23-
/** @var Logger|\PHPUnit_Framework_MockObject_MockObject */
24+
/** @var Logger|MockObject */
2425
private $viewerLoggerMock;
2526

26-
/** @var ProductMetadataInterface|\PHPUnit_Framework_MockObject_MockObject */
27+
/** @var ProductMetadataInterface|MockObject */
2728
private $productMetadataMock;
2829

29-
/** @var Log|\PHPUnit_Framework_MockObject_MockObject */
30+
/** @var Log|MockObject */
3031
private $logMock;
3132

32-
/** @var $cacheStorageMock \PHPUnit_Framework_MockObject_MockObject|CacheInterface */
33+
/** @var MockObject|CacheInterface $cacheStorageMock */
3334
private $cacheStorageMock;
3435

35-
public function setUp()
36+
protected function setUp(): void
3637
{
3738
$this->cacheStorageMock = $this->getMockBuilder(CacheInterface::class)
3839
->getMockForAbstractClass();
39-
$this->logMock = $this->getMockBuilder(Log::class)
40-
->getMock();
41-
$this->viewerLoggerMock = $this->getMockBuilder(Logger::class)
42-
->disableOriginalConstructor()
43-
->getMock();
44-
$this->productMetadataMock = $this->getMockBuilder(ProductMetadataInterface::class)
45-
->disableOriginalConstructor()
46-
->getMock();
40+
$this->logMock = $this->createMock(Log::class);
41+
$this->viewerLoggerMock = $this->createMock(Logger::class);
42+
$this->productMetadataMock = $this->getMockForAbstractClass(ProductMetadataInterface::class);
4743
$objectManager = new ObjectManager($this);
4844
$this->canViewNotification = $objectManager->getObject(
4945
CanViewNotification::class,

app/code/Magento/AdminAnalytics/composer.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0||~7.3.0",
8+
"php": "~7.3.0||~7.4.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-config": "*",
@@ -18,12 +18,11 @@
1818
"AFL-3.0"
1919
],
2020
"autoload": {
21-
"files": [
22-
"registration.php"
23-
],
24-
"psr-4": {
25-
"Magento\\AdminAnalytics\\": ""
26-
}
21+
"files": [
22+
"registration.php"
23+
],
24+
"psr-4": {
25+
"Magento\\AdminAnalytics\\": ""
26+
}
2727
}
2828
}
29-

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: 10 additions & 9 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
@@ -28,25 +29,25 @@ class ActionsTest extends TestCase
2829
*/
2930
private $sut;
3031

31-
protected function setUp() : void
32+
protected function setUp(): void
3233
{
3334
parent::setUp();
3435

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

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

43-
/** @var Context | \PHPUnit_Framework_MockObject_MockObject $contextMock */
44-
$contextMock = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
44+
/** @var Context|MockObject $contextMock */
45+
$contextMock = $this->createMock(Context::class);
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-
$urlHelperMock = $this->getMockBuilder(Data::class)->disableOriginalConstructor()->getMock();
49+
/** @var Data|MockObject $urlHelperMock */
50+
$urlHelperMock = $this->createMock(Data::class);
5051
$urlHelperMock->expects($this->once())->method('getEncodedUrl')->willReturn('http://magento.com');
5152

5253
$this->sut = new Actions($contextMock, $urlHelperMock);

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
namespace Magento\AdminNotification\Test\Unit\Block\Grid\Renderer;
1313

1414
use Magento\AdminNotification\Block\Grid\Renderer\Notice;
15+
use Magento\Backend\Block\Context;
1516
use Magento\Framework\DataObject;
1617
use Magento\Framework\Escaper;
17-
use Magento\Backend\Block\Context;
18+
use PHPUnit\Framework\MockObject\MockObject;
1819
use PHPUnit\Framework\TestCase;
1920

2021
class NoticeTest extends TestCase
@@ -26,16 +27,16 @@ class NoticeTest extends TestCase
2627
*/
2728
private $sut;
2829

29-
protected function setUp() : void
30+
protected function setUp(): void
3031
{
3132
parent::setUp();
3233

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

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

4142
$this->sut = new Notice($contextMock);

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Magento\Backend\Block\Context;
1717
use Magento\Backend\Block\Widget\Grid\Column;
1818
use Magento\Framework\DataObject;
19-
use Magento\Framework\Escaper;
19+
use PHPUnit\Framework\MockObject\MockObject;
2020
use PHPUnit\Framework\TestCase;
2121

2222
class SeverityTest extends TestCase
@@ -28,22 +28,22 @@ class SeverityTest extends TestCase
2828
*/
2929
private $sut;
3030

31-
protected function setUp() : void
31+
protected function setUp(): void
3232
{
3333
parent::setUp();
3434

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

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

4141
$this->sut = new Severity($contextMock, $inboxMock);
4242
}
4343

4444
public function testShouldRenderSeverity() : void
4545
{
46-
/** @var Column | \PHPUnit_Framework_MockObject_MockObject $columnMock */
46+
/** @var Column|MockObject $columnMock */
4747
$columnMock = $this->getMockBuilder(Column::class)
4848
->disableOriginalConstructor()
4949
->setMethods(['getIndex'])

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

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,38 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
/**
89
* Test class for \Magento\AdminNotification\Block\ToolbarEntry
910
*/
1011
namespace Magento\AdminNotification\Test\Unit\Block;
1112

12-
class ToolbarEntryTest extends \PHPUnit\Framework\TestCase
13+
use Magento\AdminNotification\Block\ToolbarEntry;
14+
use Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread;
15+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
16+
use PHPUnit\Framework\TestCase;
17+
18+
class ToolbarEntryTest extends TestCase
1319
{
1420
/**
1521
* Retrieve toolbar entry block instance
1622
*
1723
* @param int $unreadNotifications number of unread notifications
18-
* @return \Magento\AdminNotification\Block\ToolbarEntry
24+
* @return ToolbarEntry
1925
*/
2026
protected function _getBlockInstance($unreadNotifications)
2127
{
22-
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
28+
$objectManagerHelper = new ObjectManager($this);
2329
// mock collection of unread notifications
2430
$notificationList = $this->createPartialMock(
25-
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class,
31+
Unread::class,
2632
['getSize', 'setCurPage', 'setPageSize']
2733
);
28-
$notificationList->expects($this->any())->method('getSize')->will($this->returnValue($unreadNotifications));
34+
$notificationList->method('getSize')->willReturn($unreadNotifications);
2935

3036
$block = $objectManagerHelper->getObject(
31-
\Magento\AdminNotification\Block\ToolbarEntry::class,
37+
ToolbarEntry::class,
3238
['notificationList' => $notificationList]
3339
);
3440

@@ -44,26 +50,21 @@ public function testGetUnreadNotificationCount()
4450

4551
public function testGetLatestUnreadNotifications()
4652
{
47-
$helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
53+
$helper = new ObjectManager($this);
4854

4955
// 1. Create mocks
50-
$notificationList = $this->getMockBuilder(
51-
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class
52-
)
53-
->disableOriginalConstructor()
54-
->getMock();
56+
$notificationList = $this->createMock(Unread::class);
5557

56-
/** @var \Magento\AdminNotification\Block\ToolbarEntry $model */
58+
/** @var ToolbarEntry $model */
5759
$model = $helper->getObject(
58-
\Magento\AdminNotification\Block\ToolbarEntry::class,
60+
ToolbarEntry::class,
5961
['notificationList' => $notificationList]
6062
);
6163

6264
// 2. Set expectations
6365
$notificationList->expects($this->atLeastOnce())
6466
->method('setPageSize')
65-
->with(\Magento\AdminNotification\Block\ToolbarEntry::NOTIFICATIONS_NUMBER)
66-
->will($this->returnSelf());
67+
->with(ToolbarEntry::NOTIFICATIONS_NUMBER)->willReturnSelf();
6768

6869
// 3. Run tested method
6970
$result = $model->getLatestUnreadNotifications();

0 commit comments

Comments
 (0)