Skip to content

Commit b2af00b

Browse files
Merge branch 'kishore/fix-28198' of https://github.com/kishorenagalingam/magento2 into kishore/fix-28198
2 parents 4d4e07f + d0bceba commit b2af00b

File tree

12,330 files changed

+281210
-200472
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,330 files changed

+281210
-200472
lines changed

.github/CONTRIBUTING.md

+1-1
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.

.htaccess

-23
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,6 @@
3737

3838
DirectoryIndex index.php
3939

40-
<IfModule mod_php5.c>
41-
############################################
42-
## adjust memory limit
43-
44-
php_value memory_limit 756M
45-
php_value max_execution_time 18000
46-
47-
############################################
48-
## disable automatic session start
49-
## before autoload was initialized
50-
51-
php_flag session.auto_start off
52-
53-
############################################
54-
## enable resulting html compression
55-
56-
#php_flag zlib.output_compression on
57-
58-
###########################################
59-
## disable user agent verification to not break multiple image upload
60-
61-
php_flag suhosin.session.cryptua off
62-
</IfModule>
6340
<IfModule mod_php7.c>
6441
############################################
6542
## adjust memory limit

.travis.yml.sample

-68
This file was deleted.

README.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
[![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2)
2-
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
3-
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg)](https://crowdin.com/project/magento-2)
1+
<p align="center">
2+
<a href="https://magento.com">
3+
<img src="https://static.magento.com/sites/all/themes/magento/logo.svg" width="300px" alt="Magento" />
4+
</a>
5+
</p>
6+
<p align="center">
7+
<br /><br />
8+
<a href="https://www.codetriage.com/magento/magento2">
9+
<img src="https://www.codetriage.com/magento/magento2/badges/users.svg" alt="Open Source Helpers" />
10+
</a>
11+
<a href="https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge">
12+
<img src="https://badges.gitter.im/Join%20Chat.svg" alt="Gitter" />
13+
</a>
14+
<a href="https://crowdin.com/project/magento-2">
15+
<img src="https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg" alt="Crowdin" />
16+
</a>
17+
</p>
418

519
## Welcome
620
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminLoginActionGroup">
12+
<conditionalClick selector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" dependentSelector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" visible="true" stepKey="clickDontAllowButtonIfVisible" before="closeAdminNotification"/>
13+
</actionGroup>
14+
</actionGroups>

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

-14
This file was deleted.

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

-14
This file was deleted.

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

+1-1
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

+14-18
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

+7-8
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/Block/System/Messages.php

+31-28
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,54 @@
55
*/
66
namespace Magento\AdminNotification\Block\System;
77

8-
class Messages extends \Magento\Backend\Block\Template
8+
use Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized;
9+
use Magento\Backend\Block\Template;
10+
use Magento\Backend\Block\Template\Context as TemplateContext;
11+
use Magento\Framework\Json\Helper\Data as JsonDataHelper;
12+
use Magento\Framework\Notification\MessageInterface;
13+
use Magento\Framework\Serialize\Serializer\Json as JsonSerializer;
14+
15+
/**
16+
* AdminNotification Messages class
17+
*/
18+
class Messages extends Template
919
{
1020
/**
11-
* Message list
21+
* Synchronized Message collection
1222
*
13-
* @var \Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized
23+
* @var Synchronized
1424
*/
1525
protected $_messages;
1626

1727
/**
18-
* @var \Magento\Framework\Json\Helper\Data
28+
* @var JsonDataHelper
1929
* @deprecated
2030
*/
2131
protected $jsonHelper;
2232

2333
/**
24-
* @var \Magento\Framework\Serialize\Serializer\Json
34+
* @var JsonSerializer
2535
*/
2636
private $serializer;
2737

2838
/**
29-
* @param \Magento\Backend\Block\Template\Context $context
30-
* @param \Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized $messages
31-
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
39+
* @param TemplateContext $context
40+
* @param Synchronized $messages
41+
* @param JsonDataHelper $jsonHelper
42+
* @param JsonSerializer $serializer
3243
* @param array $data
33-
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
3444
*/
3545
public function __construct(
36-
\Magento\Backend\Block\Template\Context $context,
37-
\Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized $messages,
38-
\Magento\Framework\Json\Helper\Data $jsonHelper,
39-
array $data = [],
40-
\Magento\Framework\Serialize\Serializer\Json $serializer = null
46+
TemplateContext $context,
47+
Synchronized $messages,
48+
JsonDataHelper $jsonHelper,
49+
JsonSerializer $serializer,
50+
array $data = []
4151
) {
4252
$this->jsonHelper = $jsonHelper;
4353
parent::__construct($context, $data);
4454
$this->_messages = $messages;
45-
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
46-
->get(\Magento\Framework\Serialize\Serializer\Json::class);
55+
$this->serializer = $serializer;
4756
}
4857

4958
/**
@@ -62,16 +71,14 @@ protected function _toHtml()
6271
/**
6372
* Retrieve message list
6473
*
65-
* @return \Magento\Framework\Notification\MessageInterface[]
74+
* @return MessageInterface[]|null
6675
*/
6776
public function getLastCritical()
6877
{
6978
$items = array_values($this->_messages->getItems());
70-
if (isset(
71-
$items[0]
72-
) && $items[0]->getSeverity() == \Magento\Framework\Notification\MessageInterface::SEVERITY_CRITICAL
73-
) {
74-
return $items[0];
79+
80+
if (!empty($items) && current($items)->getSeverity() === MessageInterface::SEVERITY_CRITICAL) {
81+
return current($items);
7582
}
7683
return null;
7784
}
@@ -83,9 +90,7 @@ public function getLastCritical()
8390
*/
8491
public function getCriticalCount()
8592
{
86-
return $this->_messages->getCountBySeverity(
87-
\Magento\Framework\Notification\MessageInterface::SEVERITY_CRITICAL
88-
);
93+
return $this->_messages->getCountBySeverity(MessageInterface::SEVERITY_CRITICAL);
8994
}
9095

9196
/**
@@ -95,9 +100,7 @@ public function getCriticalCount()
95100
*/
96101
public function getMajorCount()
97102
{
98-
return $this->_messages->getCountBySeverity(
99-
\Magento\Framework\Notification\MessageInterface::SEVERITY_MAJOR
100-
);
103+
return $this->_messages->getCountBySeverity(MessageInterface::SEVERITY_MAJOR);
101104
}
102105

103106
/**

0 commit comments

Comments
 (0)