Skip to content

Commit

Permalink
Merge pull request #54 from magento-fearless-kiwis/FearlessKiwis-MAGE…
Browse files Browse the repository at this point in the history
…TWO-44491-Rename-Dispatch-Execute

Fearless kiwis magetwo 44491 rename dispatch execute
  • Loading branch information
Tang, Yu(ytang1) committed Oct 28, 2015
2 parents 9272b2f + 4b9a7c7 commit 550f10e
Show file tree
Hide file tree
Showing 1,135 changed files with 1,629 additions and 1,604 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AjaxMarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Not
*
* @return void
*/
public function execute()
public function executeInternal()
{
if (!$this->getRequest()->getPostValue()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Index extends \Magento\AdminNotification\Controller\Adminhtml\Notification
/**
* @return void
*/
public function execute()
public function executeInternal()
{
$this->_view->loadLayout();
$this->_setActiveMenu(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Notific
/**
* @return void
*/
public function execute()
public function executeInternal()
{
$notificationId = (int)$this->getRequest()->getParam('id');
if ($notificationId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MassMarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Not
/**
* @return void
*/
public function execute()
public function executeInternal()
{
$ids = $this->getRequest()->getParam('notification');
if (!is_array($ids)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MassRemove extends \Magento\AdminNotification\Controller\Adminhtml\Notific
/**
* @return void
*/
public function execute()
public function executeInternal()
{
$ids = $this->getRequest()->getParam('notification');
if (!is_array($ids)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Remove extends \Magento\AdminNotification\Controller\Adminhtml\Notificatio
/**
* @return void
*/
public function execute()
public function executeInternal()
{
if ($id = $this->getRequest()->getParam('id')) {
$model = $this->_objectManager->create('Magento\AdminNotification\Model\Inbox')->load($id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
/**
* @return void
*/
public function execute()
public function executeInternal()
{
$severity = $this->getRequest()->getParam('severity');
if ($severity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GetFilter extends ExportController
*
* @return \Magento\Framework\Controller\ResultInterface
*/
public function execute()
public function executeInternal()
{
$data = $this->getRequest()->getParams();
if ($this->getRequest()->isXmlHttpRequest() && $data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
*/
public function execute()
public function executeInternal()
{
$paymentParam = $this->getRequest()->getParam('payment');
$controller = $this->getRequest()->getParam('controller');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected function _returnQuote($cancelOrder, $errorMsg)
*
* @return \Magento\Framework\View\Result\Layout
*/
public function execute()
public function executeInternal()
{
$redirectParams = $this->getRequest()->getParams();
$params = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function _returnQuote()
*
* @return void
*/
public function execute()
public function executeInternal()
{
$this->_returnQuote();
$this->getResponse()->representJson(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BackendResponse extends \Magento\Authorizenet\Controller\Directpost\Paymen
*
* @return void
*/
public function execute()
public function executeInternal()
{
$this->_responseAction('adminhtml');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct(
*
* @return string
*/
public function execute()
public function executeInternal()
{
$paymentParam = $this->getRequest()->getParam('payment');
$controller = $this->getRequest()->getParam('controller');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Redirect extends \Magento\Authorizenet\Controller\Directpost\Payment
*
* @return void
*/
public function execute()
public function executeInternal()
{
$helper = $this->dataFactory->create('frontend');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Response extends \Magento\Authorizenet\Controller\Directpost\Payment
*
* @return void
*/
public function execute()
public function executeInternal()
{
$this->_responseAction('frontend');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ReturnQuote extends \Magento\Authorizenet\Controller\Directpost\Payment
*
* @return void
*/
public function execute()
public function executeInternal()
{
$this->_returnCustomerQuote();
$this->getResponse()->representJson(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ class RedirectTest extends \PHPUnit_Framework_TestCase
*/
protected $helperMock;

/**
* @var Redirect|\PHPUnit_Framework_MockObject_MockObject
*/
protected $controller;

protected function setUp()
{
$this->directpostSessionMock = $this->getMockBuilder('Magento\Authorizenet\Model\Directpost\Session')
Expand Down Expand Up @@ -196,7 +201,7 @@ protected function setUp()
);
}

public function testExecuteErrorMsgWithoutCancelOrder()
public function testExecuteInternalErrorMsgWithoutCancelOrder()
{
$params = ['success' => 0, 'error_msg' => 'Error message'];
$incrementId = 1;
Expand Down Expand Up @@ -238,10 +243,10 @@ public function testExecuteErrorMsgWithoutCancelOrder()
->method('register')
->with(Iframe::REGISTRY_KEY);

$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->execute());
$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->executeInternal());
}

public function testExecuteErrorMsgWithCancelOrder()
public function testExecuteInternalErrorMsgWithCancelOrder()
{
$params = ['success' => 0, 'error_msg' => 'Error message', 'x_invoice_num' => 1];
$incrementId = 1;
Expand Down Expand Up @@ -273,10 +278,10 @@ public function testExecuteErrorMsgWithCancelOrder()
->method('register')
->with(Iframe::REGISTRY_KEY);

$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->execute());
$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->executeInternal());
}

public function testExecuteSuccess()
public function testExecuteInternalSuccess()
{
$params = ['success' => 1, 'controller_action_name' => 'action', 'x_invoice_num' => 1];
$this->requestMock->expects($this->once())
Expand Down Expand Up @@ -307,6 +312,6 @@ public function testExecuteSuccess()
->method('register')
->with(Iframe::REGISTRY_KEY);

$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->execute());
$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->executeInternal());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function testExecute(
->method('jsonEncode')
->with($result);

$this->placeOrderController->execute();
$this->placeOrderController->executeInternal();
}

/**
Expand Down Expand Up @@ -243,7 +243,7 @@ public function testExecuteFailedPlaceOrder(
->method('jsonEncode')
->with($result);

$this->placeOrderController->execute();
$this->placeOrderController->executeInternal();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Backend/App/AbstractAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ private function _moveBlockToContainer(\Magento\Framework\View\Element\AbstractB
* @param \Magento\Framework\App\RequestInterface $request
* @return \Magento\Framework\App\ResponseInterface
*/
public function dispatch(\Magento\Framework\App\RequestInterface $request)
public function execute(\Magento\Framework\App\RequestInterface $request)
{
if (!$this->_processUrlKeys()) {
return parent::dispatch($request);
return parent::execute($request);
}

if ($request->isDispatched() && $request->getActionName() !== 'denied' && !$this->_isAllowed()) {
Expand All @@ -223,7 +223,7 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request)

$this->_processLocaleSettings();

return parent::dispatch($request);
return parent::execute($request);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function __construct(
* @return mixed
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function aroundDispatch(
public function aroundExecute(
\Magento\Backend\App\AbstractAction $subject,
\Closure $proceed,
\Magento\Framework\App\RequestInterface $request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MassactionKey
* @return mixed
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function aroundDispatch(
public function aroundExecute(
\Magento\Backend\App\AbstractAction $subject,
\Closure $proceed,
\Magento\Framework\App\RequestInterface $request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(
*
* @return \Magento\Framework\Controller\Result\Json
*/
public function execute()
public function executeInternal()
{
$translate = (array)$this->getRequest()->getPost('translate');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function _getDeniedIframe()
*
* @return \Magento\Framework\Controller\Result\Raw
*/
public function execute()
public function executeInternal()
{
/** @var \Magento\Framework\Controller\Result\Raw $resultRaw */
$resultRaw = $this->resultRawFactory->create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function _getDeniedJson()
*
* @return \Magento\Framework\Controller\Result\Json
*/
public function execute()
public function executeInternal()
{
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
$resultJson = $this->resultJsonFactory->create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
public function executeInternal()
{
if ($this->_auth->isLoggedIn()) {
if ($this->_auth->getAuthStorage()->isFirstPageAfterLogin()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Logout extends \Magento\Backend\Controller\Adminhtml\Auth
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
public function executeInternal()
{
$this->_auth->logout();
$this->messageManager->addSuccess(__('You have logged out.'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
/**
* @return \Magento\Framework\Controller\ResultInterface
*/
public function execute()
public function executeInternal()
{
$resultRedirect = $this->resultRedirectFactory->create();
if ($this->getRequest()->getParam('app')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CleanImages extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
public function executeInternal()
{
try {
$this->_objectManager->create('Magento\Catalog\Model\Product\Image')->clearCache();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CleanMedia extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
public function executeInternal()
{
try {
$this->_objectManager->get('Magento\Framework\View\Asset\MergeService')->cleanMergedJsCss();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CleanStaticFiles extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
public function executeInternal()
{
$this->_objectManager->get('Magento\Framework\App\State\CleanupFiles')->clearMaterializedViewFiles();
$this->_eventManager->dispatch('clean_static_files_cache_after');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FlushAll extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
public function executeInternal()
{
$this->_eventManager->dispatch('adminhtml_cache_flush_all');
/** @var $cacheFrontend \Magento\Framework\Cache\FrontendInterface */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FlushSystem extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
public function executeInternal()
{
/** @var $cacheFrontend \Magento\Framework\Cache\FrontendInterface */
foreach ($this->_cacheFrontendPool as $cacheFrontend) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Index extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Page
*/
public function execute()
public function executeInternal()
{
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->resultPageFactory->create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MassDisable extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
public function executeInternal()
{
try {
$types = $this->getRequest()->getParam('types');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MassEnable extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
public function executeInternal()
{
try {
$types = $this->getRequest()->getParam('types');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MassRefresh extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function execute()
public function executeInternal()
{
try {
$types = $this->getRequest()->getParam('types');
Expand Down
Loading

0 comments on commit 550f10e

Please sign in to comment.