Skip to content

Commit

Permalink
Merge branch '2.4-develop' into performance-inline-translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Krzeszowiak committed May 21, 2020
2 parents 1861c47 + 56ae4d5 commit d7305bc
Show file tree
Hide file tree
Showing 8,640 changed files with 164,818 additions and 109,875 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 10 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Fields marked with (*) are required. Please don't remove the template.

### Preconditions (*)
<!---
Provide the exact Magento version (example: 2.3.2) and any important information on the environment where bug is reproducible.
Provide the exact Magento version (example: 2.4.0) and any important information on the environment where bug is reproducible.
-->
1.
2.
Expand All @@ -32,3 +32,12 @@ Important: Provide a set of clear steps to reproduce this bug. We can not provid
<!--- Tell us what happened instead. Include error messages and issues. -->
1. [Screenshots, logs or description]
2.

---
Please provide [Severity](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

- [ ] Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._
- [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._
- [ ] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._
- [ ] Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._
- [ ] Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/developer-experience-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ Fields marked with (*) are required. Please don't remove the template.

### Proposed solution
<!--- Suggest your potential solutions for this issue. -->

---
Please provide [Severity](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

- [ ] Severity: **S0** _- Affects critical data or functionality and leaves users with no workaround._
- [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._
- [ ] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._
- [ ] Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._
- [ ] Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
If relevant, please provide a list of fixed issues in the format magento/magento2#<issue_number>.
There could be 1 or more issues linked here and it will help us find some more information about the reasoning behind this change.
-->
1. magento/magento2#<issue_number>: Issue title
1. Fixes magento/magento2#<issue_number>

### Manual testing scenarios (*)
<!---
Expand Down
68 changes: 0 additions & 68 deletions .travis.yml.sample

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\AdminAnalytics\Test\Unit\Condition;

use Magento\AdminAnalytics\Model\Condition\CanViewNotification;
use Magento\AdminAnalytics\Model\ResourceModel\Viewer\Logger;
use Magento\AdminAnalytics\Model\Viewer\Log;
use Magento\Framework\App\CacheInterface;
use Magento\Framework\App\ProductMetadataInterface;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use Magento\Framework\App\CacheInterface;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

Expand All @@ -28,21 +30,16 @@ class CanViewNotificationTest extends TestCase
/** @var Log|MockObject */
private $logMock;

/** @var $cacheStorageMock MockObject|CacheInterface */
/** @var MockObject|CacheInterface $cacheStorageMock */
private $cacheStorageMock;

protected function setUp(): void
{
$this->cacheStorageMock = $this->getMockBuilder(CacheInterface::class)
->getMockForAbstractClass();
$this->logMock = $this->getMockBuilder(Log::class)
->getMock();
$this->viewerLoggerMock = $this->getMockBuilder(Logger::class)
->disableOriginalConstructor()
->getMock();
$this->productMetadataMock = $this->getMockBuilder(ProductMetadataInterface::class)
->disableOriginalConstructor()
->getMock();
$this->logMock = $this->createMock(Log::class);
$this->viewerLoggerMock = $this->createMock(Logger::class);
$this->productMetadataMock = $this->getMockForAbstractClass(ProductMetadataInterface::class);
$objectManager = new ObjectManager($this);
$this->canViewNotification = $objectManager->getObject(
CanViewNotification::class,
Expand Down
15 changes: 7 additions & 8 deletions app/code/Magento/AdminAnalytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.1.3||~7.2.0||~7.3.0",
"php": "~7.3.0||~7.4.0",
"magento/framework": "*",
"magento/module-backend": "*",
"magento/module-config": "*",
Expand All @@ -18,12 +18,11 @@
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Magento\\AdminAnalytics\\": ""
}
"files": [
"registration.php"
],
"psr-4": {
"Magento\\AdminAnalytics\\": ""
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ class ActionsTest extends TestCase
*/
private $sut;

protected function setUp() : void
protected function setUp(): void
{
parent::setUp();

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

/** @var UrlInterface|MockObject $urlBuilder */
$urlBuilder = $this->getMockBuilder(UrlInterface::class)->getMock();
$urlBuilder = $this->getMockForAbstractClass(UrlInterface::class);
$urlBuilder->expects($this->once())->method('getUrl')->willReturn('http://magento.com');

/** @var Context|MockObject $contextMock */
$contextMock = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
$contextMock = $this->createMock(Context::class);
$contextMock->expects($this->once())->method('getEscaper')->willReturn($escaperMock);
$contextMock->expects($this->once())->method('getUrlBuilder')->willReturn($urlBuilder);

/** @var Data|MockObject $urlHelperMock */
$urlHelperMock = $this->getMockBuilder(Data::class)->disableOriginalConstructor()->getMock();
$urlHelperMock = $this->createMock(Data::class);
$urlHelperMock->expects($this->once())->method('getEncodedUrl')->willReturn('http://magento.com');

$this->sut = new Actions($contextMock, $urlHelperMock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
namespace Magento\AdminNotification\Test\Unit\Block\Grid\Renderer;

use Magento\AdminNotification\Block\Grid\Renderer\Notice;
use Magento\Backend\Block\Context;
use Magento\Framework\DataObject;
use Magento\Framework\Escaper;
use Magento\Backend\Block\Context;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

Expand All @@ -27,16 +27,16 @@ class NoticeTest extends TestCase
*/
private $sut;

protected function setUp() : void
protected function setUp(): void
{
parent::setUp();

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

/** @var Context|MockObject $contextMock */
$contextMock = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
$contextMock = $this->createMock(Context::class);
$contextMock->expects($this->once())->method('getEscaper')->willReturn($escaperMock);

$this->sut = new Notice($contextMock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Magento\Backend\Block\Context;
use Magento\Backend\Block\Widget\Grid\Column;
use Magento\Framework\DataObject;
use Magento\Framework\Escaper;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

Expand All @@ -29,15 +28,15 @@ class SeverityTest extends TestCase
*/
private $sut;

protected function setUp() : void
protected function setUp(): void
{
parent::setUp();

/** @var Inbox|MockObject $inboxMock */
$inboxMock = $this->getMockBuilder(Inbox::class)->disableOriginalConstructor()->getMock();
$inboxMock = $this->createMock(Inbox::class);

/** @var Context|MockObject $contextMock */
$contextMock = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
$contextMock = $this->createMock(Context::class);

$this->sut = new Severity($contextMock, $inboxMock);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

/**
* Test class for \Magento\AdminNotification\Block\ToolbarEntry
Expand Down Expand Up @@ -30,7 +31,7 @@ protected function _getBlockInstance($unreadNotifications)
Unread::class,
['getSize', 'setCurPage', 'setPageSize']
);
$notificationList->expects($this->any())->method('getSize')->will($this->returnValue($unreadNotifications));
$notificationList->method('getSize')->willReturn($unreadNotifications);

$block = $objectManagerHelper->getObject(
ToolbarEntry::class,
Expand All @@ -52,9 +53,7 @@ public function testGetLatestUnreadNotifications()
$helper = new ObjectManager($this);

// 1. Create mocks
$notificationList = $this->getMockBuilder(Unread::class)
->disableOriginalConstructor()
->getMock();
$notificationList = $this->createMock(Unread::class);

/** @var ToolbarEntry $model */
$model = $helper->getObject(
Expand All @@ -65,8 +64,7 @@ public function testGetLatestUnreadNotifications()
// 2. Set expectations
$notificationList->expects($this->atLeastOnce())
->method('setPageSize')
->with(ToolbarEntry::NOTIFICATIONS_NUMBER)
->will($this->returnSelf());
->with(ToolbarEntry::NOTIFICATIONS_NUMBER)->willReturnSelf();

// 3. Run tested method
$result = $model->getLatestUnreadNotifications();
Expand Down
36 changes: 17 additions & 19 deletions app/code/Magento/AdminNotification/Test/Unit/Model/FeedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\AdminNotification\Test\Unit\Model;

Expand Down Expand Up @@ -70,13 +71,12 @@ protected function setUp(): void
['create']
);
$this->curlFactory = $this->createPartialMock(CurlFactory::class, ['create']);
$this->curl = $this->getMockBuilder(Curl::class)
->disableOriginalConstructor()->getMock();
$this->curl = $this->createMock(Curl::class);
$this->appState = $this->createPartialMock(State::class, []);
$this->inboxModel = $this->createPartialMock(Inbox::class, [
'__wakeup',
'parse'
]);
'__wakeup',
'parse'
]);
$this->backendConfig = $this->createPartialMock(
ConfigInterface::class,
[
Expand All @@ -96,15 +96,13 @@ protected function setUp(): void
]
);

$this->deploymentConfig = $this->getMockBuilder(DeploymentConfig::class)
->disableOriginalConstructor()->getMock();
$this->deploymentConfig = $this->createMock(DeploymentConfig::class);

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

$this->productMetadata = $this->getMockBuilder(ProductMetadata::class)
->disableOriginalConstructor()->getMock();
$this->productMetadata = $this->createMock(ProductMetadata::class);

$this->urlBuilder = $this->createMock(UrlInterface::class);
$this->urlBuilder = $this->getMockForAbstractClass(UrlInterface::class);

$this->feed = $this->objectManagerHelper->getObject(
Feed::class,
Expand Down Expand Up @@ -145,20 +143,20 @@ public function testCheckUpdate($callInbox, $curlRequest)
];

$lastUpdate = 0;
$this->cacheManager->expects($this->once())->method('load')->will(($this->returnValue($lastUpdate)));
$this->curlFactory->expects($this->at(0))->method('create')->will($this->returnValue($this->curl));
$this->cacheManager->expects($this->once())->method('load')->willReturn($lastUpdate);
$this->curlFactory->expects($this->at(0))->method('create')->willReturn($this->curl);
$this->curl->expects($this->once())->method('setConfig')->with($configValues)->willReturnSelf();
$this->curl->expects($this->once())->method('read')->will($this->returnValue($curlRequest));
$this->backendConfig->expects($this->at(0))->method('getValue')->will($this->returnValue('1'));
$this->backendConfig->expects($this->once())->method('isSetFlag')->will($this->returnValue(false));
$this->curl->expects($this->once())->method('read')->willReturn($curlRequest);
$this->backendConfig->expects($this->at(0))->method('getValue')->willReturn('1');
$this->backendConfig->expects($this->once())->method('isSetFlag')->willReturn(false);
$this->backendConfig->expects($this->at(1))->method('getValue')
->will($this->returnValue('http://feed.magento.com'));
->willReturn('http://feed.magento.com');
$this->deploymentConfig->expects($this->once())->method('get')
->with(ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE)
->will($this->returnValue('Sat, 6 Sep 2014 16:46:11 UTC'));
->willReturn('Sat, 6 Sep 2014 16:46:11 UTC');
if ($callInbox) {
$this->inboxFactory->expects($this->once())->method('create')
->will($this->returnValue($this->inboxModel));
->willReturn($this->inboxModel);
$this->inboxModel->expects($this->once())
->method('parse')
->with(
Expand All @@ -178,7 +176,7 @@ function ($initialValue, $item) use ($data) {
}
)
)
->will($this->returnSelf());
->willReturnSelf();
} else {
$this->inboxFactory->expects($this->never())->method('create');
$this->inboxModel->expects($this->never())->method('parse');
Expand Down
Loading

0 comments on commit d7305bc

Please sign in to comment.