Skip to content

Commit

Permalink
MAGETWO-71933: Issue #10645 - Allow BEM class via attribute tag. Public
Browse files Browse the repository at this point in the history
#10655

 - Merge Pull Request #10655 from DaniloEmpire/magento2:issue_10645
 - Merged commits:
   1. 320e53e
   2. f30af41
  • Loading branch information
Oleksii Korshenko committed Aug 25, 2017
2 parents c955c32 + f30af41 commit 7bb7c34
Show file tree
Hide file tree
Showing 10,169 changed files with 68,263 additions and 74,781 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/.metadata
/.project
/.settings
/.vscode
atlassian*
/nbproject
/robots.txt
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ script:
- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true

# The scripts for grunt/phpunit type tests
- if [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

namespace Magento\AdminNotification\Block\Grid\Renderer;

/**
* Class \Magento\AdminNotification\Block\Grid\Renderer\Actions
*
*/
class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
*/
namespace Magento\AdminNotification\Block\Grid\Renderer;

/**
* Class \Magento\AdminNotification\Block\Grid\Renderer\Notice
*
*/
class Notice extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

use Magento\Framework\Notification\MessageInterface;

/**
* Class \Magento\AdminNotification\Block\Grid\Renderer\Severity
*
*/
class Severity extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
{
/**
Expand Down
4 changes: 4 additions & 0 deletions app/code/Magento/AdminNotification/Block/System/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*/
namespace Magento\AdminNotification\Block\System;

/**
* Class \Magento\AdminNotification\Block\System\Messages
*
*/
class Messages extends \Magento\Backend\Block\Template
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,35 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;

use Magento\Backend\App\Action;
use Magento\Framework\Controller\ResultFactory;

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

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

/**
* Mark notification as read (AJAX action)
*
* @return void
* @return \Magento\Framework\Controller\Result\Json|void
* @throws \InvalidArgumentException
*/
public function execute()
{
Expand All @@ -21,17 +44,15 @@ public function execute()
$notificationId = (int)$this->getRequest()->getPost('id');
$responseData = [];
try {
$this->_objectManager->create(
\Magento\AdminNotification\Model\NotificationService::class
)->markAsRead(
$notificationId
);
$this->notificationService->markAsRead($notificationId);
$responseData['success'] = true;
} catch (\Exception $e) {
$responseData['success'] = false;
}
$this->getResponse()->representJson(
$this->_objectManager->create(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($responseData)
);

/** @var \Magento\Framework\Controller\Result\Json $resultJson */
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
$resultJson->setData($responseData);
return $resultJson;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;

/**
* Class \Magento\AdminNotification\Controller\Adminhtml\Notification\Index
*
*/
class Index extends \Magento\AdminNotification\Controller\Adminhtml\Notification
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;

/**
* Class \Magento\AdminNotification\Controller\Adminhtml\Notification\MarkAsRead
*
*/
class MarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Notification
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;

/**
* Class \Magento\AdminNotification\Controller\Adminhtml\Notification\MassMarkAsRead
*
*/
class MassMarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Notification
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;

/**
* Class \Magento\AdminNotification\Controller\Adminhtml\Notification\MassRemove
*
*/
class MassRemove extends \Magento\AdminNotification\Controller\Adminhtml\Notification
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;

/**
* Class \Magento\AdminNotification\Controller\Adminhtml\Notification\Remove
*
*/
class Remove extends \Magento\AdminNotification\Controller\Adminhtml\Notification
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml\System\Message;

/**
* Class \Magento\AdminNotification\Controller\Adminhtml\System\Message\ListAction
*
*/
class ListAction extends \Magento\Backend\App\AbstractAction
{
/**
Expand Down
2 changes: 0 additions & 2 deletions app/code/Magento/AdminNotification/Model/Inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/**
* AdminNotification Inbox model
*
* @method \Magento\AdminNotification\Model\ResourceModel\Inbox _getResource()
* @method \Magento\AdminNotification\Model\ResourceModel\Inbox getResource()
* @method int getSeverity()
* @method \Magento\AdminNotification\Model\Inbox setSeverity(int $value)
* @method string getDateAdded()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Magento\Store\Model\Store;

/**
* @deprecated
* @deprecated 100.1.0
*/
class Baseurl implements \Magento\Framework\Notification\MessageInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
namespace Magento\AdminNotification\Test\Unit\Block;

class ToolbarEntryTest extends \PHPUnit_Framework_TestCase
class ToolbarEntryTest extends \PHPUnit\Framework\TestCase
{
/**
* Retrieve toolbar entry block instance
Expand All @@ -21,12 +21,9 @@ protected function _getBlockInstance($unreadNotifications)
{
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
// mock collection of unread notifications
$notificationList = $this->getMock(
$notificationList = $this->createPartialMock(
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class,
['getSize', 'setCurPage', 'setPageSize'],
[],
'',
false
['getSize', 'setCurPage', 'setPageSize']
);
$notificationList->expects($this->any())->method('getSize')->will($this->returnValue($unreadNotifications));

Expand Down
37 changes: 11 additions & 26 deletions app/code/Magento/AdminNotification/Test/Unit/Model/FeedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

namespace Magento\AdminNotification\Test\Unit\Model;

use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
use Magento\Framework\Config\ConfigOptionsListConstants;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class FeedTest extends \PHPUnit_Framework_TestCase
class FeedTest extends \PHPUnit\Framework\TestCase
{
/** @var \Magento\AdminNotification\Model\Feed */
protected $feed;
Expand Down Expand Up @@ -52,42 +52,27 @@ class FeedTest extends \PHPUnit_Framework_TestCase

protected function setUp()
{
$this->inboxFactory = $this->getMock(
$this->inboxFactory = $this->createPartialMock(
\Magento\AdminNotification\Model\InboxFactory::class,
['create'],
[],
'',
false
);
$this->curlFactory = $this->getMock(
\Magento\Framework\HTTP\Adapter\CurlFactory::class,
['create'],
[],
'',
false
['create']
);
$this->curlFactory = $this->createPartialMock(\Magento\Framework\HTTP\Adapter\CurlFactory::class, ['create']);
$this->curl = $this->getMockBuilder(\Magento\Framework\HTTP\Adapter\Curl::class)
->disableOriginalConstructor()->getMock();
$this->appState = $this->getMock(\Magento\Framework\App\State::class, ['getInstallDate'], [], '', false);
$this->inboxModel = $this->getMock(
\Magento\AdminNotification\Model\Inbox::class,
[
$this->appState = $this->createPartialMock(\Magento\Framework\App\State::class, ['getInstallDate']);
$this->inboxModel = $this->createPartialMock(\Magento\AdminNotification\Model\Inbox::class, [
'__wakeup',
'parse'
],
[],
'',
false
);
$this->backendConfig = $this->getMock(
]);
$this->backendConfig = $this->createPartialMock(
\Magento\Backend\App\ConfigInterface::class,
[
'getValue',
'setValue',
'isSetFlag'
]
);
$this->cacheManager = $this->getMock(
$this->cacheManager = $this->createPartialMock(
\Magento\Framework\App\CacheInterface::class,
[
'load',
Expand All @@ -106,7 +91,7 @@ protected function setUp()
$this->productMetadata = $this->getMockBuilder(\Magento\Framework\App\ProductMetadata::class)
->disableOriginalConstructor()->getMock();

$this->urlBuilder = $this->getMock(\Magento\Framework\UrlInterface::class);
$this->urlBuilder = $this->createMock(\Magento\Framework\UrlInterface::class);

$this->feed = $this->objectManagerHelper->getObject(
\Magento\AdminNotification\Model\Feed::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
namespace Magento\AdminNotification\Test\Unit\Model;

class NotificationServiceTest extends \PHPUnit_Framework_TestCase
class NotificationServiceTest extends \PHPUnit\Framework\TestCase
{
/**
* Retrieve instance of notification service model
Expand All @@ -23,19 +23,13 @@ protected function _getServiceInstanceForMarkAsReadTest($notificationId)
* @var
* $notificationFactory \PHPUnit_Framework_MockObject_MockObject|\Magento\AdminNotification\Model\InboxFactory
*/
$notificationFactory = $this->getMock(
$notificationFactory = $this->createPartialMock(
\Magento\AdminNotification\Model\InboxFactory::class,
['create'],
[],
'',
false
['create']
);
$notification = $this->getMock(
$notification = $this->createPartialMock(
\Magento\AdminNotification\Model\Inbox::class,
['load', 'getId', 'save', 'setIsRead', '__sleep', '__wakeup'],
[],
'',
false
['load', 'getId', 'save', 'setIsRead', '__sleep', '__wakeup']
);
$notification->expects($this->once())->method('load')->with($notificationId)->will($this->returnSelf());
$notification->expects($this->once())->method('getId')->will($this->returnValue($notificationId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
namespace Magento\AdminNotification\Test\Unit\Model\System\Message;

class CacheOutdatedTest extends \PHPUnit_Framework_TestCase
class CacheOutdatedTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \PHPUnit_Framework_MockObject_MockObject
Expand All @@ -29,9 +29,9 @@ class CacheOutdatedTest extends \PHPUnit_Framework_TestCase

protected function setUp()
{
$this->_authorizationMock = $this->getMock(\Magento\Framework\AuthorizationInterface::class);
$this->_urlInterfaceMock = $this->getMock(\Magento\Framework\UrlInterface::class);
$this->_cacheTypeListMock = $this->getMock(\Magento\Framework\App\Cache\TypeListInterface::class);
$this->_authorizationMock = $this->createMock(\Magento\Framework\AuthorizationInterface::class);
$this->_urlInterfaceMock = $this->createMock(\Magento\Framework\UrlInterface::class);
$this->_cacheTypeListMock = $this->createMock(\Magento\Framework\App\Cache\TypeListInterface::class);

$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
$arguments = [
Expand Down Expand Up @@ -64,10 +64,10 @@ public function testGetIdentity($expectedSum, $cacheTypes)

public function getIdentityDataProvider()
{
$cacheTypeMock1 = $this->getMock(\stdClass::class, ['getCacheType']);
$cacheTypeMock1 = $this->createPartialMock(\stdClass::class, ['getCacheType']);
$cacheTypeMock1->expects($this->any())->method('getCacheType')->will($this->returnValue('Simple'));

$cacheTypeMock2 = $this->getMock(\stdClass::class, ['getCacheType']);
$cacheTypeMock2 = $this->createPartialMock(\stdClass::class, ['getCacheType']);
$cacheTypeMock2->expects($this->any())->method('getCacheType')->will($this->returnValue('Advanced'));

return [
Expand Down Expand Up @@ -97,7 +97,7 @@ public function testIsDisplayed($expected, $allowed, $cacheTypes)

public function isDisplayedDataProvider()
{
$cacheTypesMock = $this->getMock(\stdClass::class, ['getCacheType']);
$cacheTypesMock = $this->createPartialMock(\stdClass::class, ['getCacheType']);
$cacheTypesMock->expects($this->any())->method('getCacheType')->will($this->returnValue('someVal'));
$cacheTypes = [$cacheTypesMock, $cacheTypesMock];
return [
Expand Down
Loading

0 comments on commit 7bb7c34

Please sign in to comment.