Skip to content

Commit 48d28e4

Browse files
author
Yuri Kovsher
committed
MAGETWO-34989: Implement getDefaultRedirect() method
1 parent 3601722 commit 48d28e4

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

app/code/Magento/Catalog/Controller/Index/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22
/**
3-
*
43
* Copyright © 2015 Magento. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76
namespace Magento\Catalog\Controller\Index;
87

98
use Magento\Framework\App\Action\Context;
9+
1010
class Index extends \Magento\Framework\App\Action\Action
1111
{
1212
/**

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Action/Attribute/SaveTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ protected function prepareContext()
216216
$this->context->expects($this->any())->method('getFormKeyValidator')->willReturn($this->formKeyValidator);
217217
$this->context->expects($this->any())->method('getTitle')->willReturn($this->title);
218218
$this->context->expects($this->any())->method('getLocaleResolver')->willReturn($this->localeResolver);
219-
$this->context->expects($this->any())->method('getResultRedirectFactory')->willReturn($this->resultRedirectFactory);
219+
$this->context->expects($this->any())
220+
->method('getResultRedirectFactory')
221+
->willReturn($this->resultRedirectFactory);
220222

221223
$this->product = $this->getMock(
222224
'Magento\Catalog\Model\Product',

app/code/Magento/Search/Test/Unit/Controller/Adminhtml/Term/MassDeleteTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ protected function setUp()
7373
->method('create')
7474
->will($this->returnValue($this->redirect));
7575
$this->context = $this->getMockBuilder('Magento\Backend\App\Action\Context')
76-
->setMethods(['getRequest', 'getResponse', 'getObjectManager', 'getMessageManager', 'getResultRedirectFactory'])
76+
->setMethods(
77+
['getRequest', 'getResponse', 'getObjectManager', 'getMessageManager', 'getResultRedirectFactory']
78+
)
7779
->disableOriginalConstructor()
7880
->getMock();
7981
$this->context->expects($this->atLeastOnce())

lib/internal/Magento/Framework/App/Action/AbstractAction.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,13 @@ abstract class AbstractAction implements \Magento\Framework\App\ActionInterface
2525
protected $resultRedirectFactory;
2626

2727
/**
28-
* @param \Magento\Framework\App\RequestInterface $request
29-
* @param \Magento\Framework\App\ResponseInterface $response
3028
* @param \Magento\Framework\App\Action\Context $context
3129
*/
3230
public function __construct(
33-
\Magento\Framework\App\RequestInterface $request,
34-
\Magento\Framework\App\ResponseInterface $response,
3531
\Magento\Framework\App\Action\Context $context
3632
) {
37-
$this->_request = $request;
38-
$this->_response = $response;
33+
$this->_request = $context->getRequest();
34+
$this->_response = $context->getResponse();
3935
$this->resultRedirectFactory = $context->getResultRedirectFactory();
4036
}
4137

lib/internal/Magento/Framework/App/Action/Action.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Action extends AbstractAction
6565
*/
6666
public function __construct(Context $context)
6767
{
68-
parent::__construct($context->getRequest(), $context->getResponse(), $context);
68+
parent::__construct($context);
6969
$this->_objectManager = $context->getObjectManager();
7070
$this->_eventManager = $context->getEventManager();
7171
$this->_url = $context->getUrl();

lib/internal/Magento/Framework/App/Test/Unit/View/Deployment/VersionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
use \Magento\Framework\App\View\Deployment\Version;
1010

11-
1211
class VersionTest extends \PHPUnit_Framework_TestCase
1312
{
1413
/**

0 commit comments

Comments
 (0)