Skip to content

Commit

Permalink
Merge branch '2.4-develop' into hot/fix-27099
Browse files Browse the repository at this point in the history
  • Loading branch information
slavvka authored May 12, 2020
2 parents 017d9de + 40a7876 commit 723d310
Show file tree
Hide file tree
Showing 11,232 changed files with 242,324 additions and 191,712 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If you are a new GitHub user, we recommend that you create your own [free github
This will allow you to collaborate with the Magento 2 development team, fork the Magento 2 project and send pull requests.

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.
2. Review the [Contributor License Agreement](https://magento.com/legaldocuments/mca) if this is your first time contributing.
2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing.
3. Create and test your work.
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).
5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed.
Expand Down
23 changes: 0 additions & 23 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,6 @@

DirectoryIndex index.php

<IfModule mod_php5.c>
############################################
## adjust memory limit

php_value memory_limit 756M
php_value max_execution_time 18000

############################################
## disable automatic session start
## before autoload was initialized

php_flag session.auto_start off

############################################
## enable resulting html compression

#php_flag zlib.output_compression on

###########################################
## disable user agent verification to not break multiple image upload

php_flag suhosin.session.cryptua off
</IfModule>
<IfModule mod_php7.c>
############################################
## adjust memory limit
Expand Down
68 changes: 0 additions & 68 deletions .travis.yml.sample

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
</annotations>

<!-- Logging in Magento admin -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,43 @@
* 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;

/**
* Class CanViewNotificationTest
*/
class CanViewNotificationTest extends \PHPUnit\Framework\TestCase
class CanViewNotificationTest extends TestCase
{
/** @var CanViewNotification */
private $canViewNotification;

/** @var Logger|\PHPUnit_Framework_MockObject_MockObject */
/** @var Logger|MockObject */
private $viewerLoggerMock;

/** @var ProductMetadataInterface|\PHPUnit_Framework_MockObject_MockObject */
/** @var ProductMetadataInterface|MockObject */
private $productMetadataMock;

/** @var Log|\PHPUnit_Framework_MockObject_MockObject */
/** @var Log|MockObject */
private $logMock;

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

public function setUp()
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\\": ""
}
}
}

59 changes: 31 additions & 28 deletions app/code/Magento/AdminNotification/Block/System/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,54 @@
*/
namespace Magento\AdminNotification\Block\System;

class Messages extends \Magento\Backend\Block\Template
use Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized;
use Magento\Backend\Block\Template;
use Magento\Backend\Block\Template\Context as TemplateContext;
use Magento\Framework\Json\Helper\Data as JsonDataHelper;
use Magento\Framework\Notification\MessageInterface;
use Magento\Framework\Serialize\Serializer\Json as JsonSerializer;

/**
* AdminNotification Messages class
*/
class Messages extends Template
{
/**
* Message list
* Synchronized Message collection
*
* @var \Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized
* @var Synchronized
*/
protected $_messages;

/**
* @var \Magento\Framework\Json\Helper\Data
* @var JsonDataHelper
* @deprecated
*/
protected $jsonHelper;

/**
* @var \Magento\Framework\Serialize\Serializer\Json
* @var JsonSerializer
*/
private $serializer;

/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized $messages
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
* @param TemplateContext $context
* @param Synchronized $messages
* @param JsonDataHelper $jsonHelper
* @param JsonSerializer $serializer
* @param array $data
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized $messages,
\Magento\Framework\Json\Helper\Data $jsonHelper,
array $data = [],
\Magento\Framework\Serialize\Serializer\Json $serializer = null
TemplateContext $context,
Synchronized $messages,
JsonDataHelper $jsonHelper,
JsonSerializer $serializer,
array $data = []
) {
$this->jsonHelper = $jsonHelper;
parent::__construct($context, $data);
$this->_messages = $messages;
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Framework\Serialize\Serializer\Json::class);
$this->serializer = $serializer;
}

/**
Expand All @@ -62,16 +71,14 @@ protected function _toHtml()
/**
* Retrieve message list
*
* @return \Magento\Framework\Notification\MessageInterface[]
* @return MessageInterface[]|null
*/
public function getLastCritical()
{
$items = array_values($this->_messages->getItems());
if (isset(
$items[0]
) && $items[0]->getSeverity() == \Magento\Framework\Notification\MessageInterface::SEVERITY_CRITICAL
) {
return $items[0];

if (!empty($items) && current($items)->getSeverity() === MessageInterface::SEVERITY_CRITICAL) {
return current($items);
}
return null;
}
Expand All @@ -83,9 +90,7 @@ public function getLastCritical()
*/
public function getCriticalCount()
{
return $this->_messages->getCountBySeverity(
\Magento\Framework\Notification\MessageInterface::SEVERITY_CRITICAL
);
return $this->_messages->getCountBySeverity(MessageInterface::SEVERITY_CRITICAL);
}

/**
Expand All @@ -95,9 +100,7 @@ public function getCriticalCount()
*/
public function getMajorCount()
{
return $this->_messages->getCountBySeverity(
\Magento\Framework\Notification\MessageInterface::SEVERITY_MAJOR
);
return $this->_messages->getCountBySeverity(MessageInterface::SEVERITY_MAJOR);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;

use Magento\AdminNotification\Controller\Adminhtml\Notification;
use Magento\AdminNotification\Model\NotificationService;
use Magento\Backend\App\Action;
use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\Controller\ResultFactory;

class AjaxMarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Notification
/**
* AdminNotification AjaxMarkAsRead controller
*/
class AjaxMarkAsRead extends Notification implements HttpPostActionInterface
{
/**
* @var \Magento\AdminNotification\Model\NotificationService
* @var NotificationService
*/
private $notificationService;

/**
* @param Action\Context $context
* @param \Magento\AdminNotification\Model\NotificationService|null $notificationService
* @throws \RuntimeException
* @param NotificationService $notificationService
*/
public function __construct(
Action\Context $context,
\Magento\AdminNotification\Model\NotificationService $notificationService = null
) {
public function __construct(Action\Context $context, NotificationService $notificationService)
{
parent::__construct($context);
$this->notificationService = $notificationService?: \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\AdminNotification\Model\NotificationService::class);
$this->notificationService = $notificationService;
}

/**
Expand Down
Loading

0 comments on commit 723d310

Please sign in to comment.