Skip to content

Commit 3ab5b37

Browse files
committed
Merge pull request #121 from magento-extensibility/ashsmith-865-add-getParams-setParams-to-request-interface
[Github] Merge public Github commits
2 parents 77b71ad + 2e9764c commit 3ab5b37

File tree

40 files changed

+256
-592
lines changed

40 files changed

+256
-592
lines changed

dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class RequestTest extends \PHPUnit_Framework_TestCase
1717
protected function setUp()
1818
{
1919
$this->_model = new \Magento\TestFramework\Request(
20-
$this->getMock('Magento\Framework\App\Route\ConfigInterface\Proxy', [], [], '', false),
21-
$this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface', [], [], '', false),
2220
$this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'),
21+
$this->getMock('Magento\Framework\App\Route\ConfigInterface\Proxy', [], [], '', false),
22+
$this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'),
2323
$this->getMock('Magento\Framework\ObjectManagerInterface')
2424
);
2525
}

dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ protected function setUp()
1919
{
2020
$this->messageManager = $this->getMock('\Magento\Framework\Message\Manager', [], [], '', false);
2121
$request = new \Magento\TestFramework\Request(
22-
$this->getMock('Magento\Framework\App\Route\ConfigInterface\Proxy', [], [], '', false),
23-
$this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface', [], [], '', false),
2422
$this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'),
23+
$this->getMock('Magento\Framework\App\Route\ConfigInterface\Proxy', [], [], '', false),
24+
$this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'),
2525
$this->getMock('Magento\Framework\ObjectManagerInterface')
2626
);
2727
$response = new \Magento\TestFramework\Response(

dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,6 @@
20872087
['getFiles', 'Magento\Framework\App\Request\Http'],
20882088
['getAlias', 'Magento\Framework\App\Request\Http', 'Magento\Framework\HTTP\PhpEnvironment\Request'],
20892089
['setAlias', 'Magento\Framework\App\Request\Http', 'Magento\Framework\HTTP\PhpEnvironment\Request'],
2090-
['getParam', 'Magento\Framework\App\RequestInterface'],
20912090
[
20922091
'render',
20932092
'Magento\Framework\Webapi\ErrorProcessor',

dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/SaveTest.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase
2727
/** @var \Magento\Backend\App\Action\Context|\PHPUnit_Framework_MockObject_MockObject */
2828
protected $context;
2929

30-
/** @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */
30+
/** @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */
3131
protected $request;
3232

3333
/** @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */
@@ -150,13 +150,8 @@ protected function prepareContext()
150150
->disableOriginalConstructor()
151151
->getMock();
152152

153-
$this->request = $this->getMock(
154-
'Magento\Framework\App\RequestInterface',
155-
['getParam', 'getModuleName', 'setModuleName', 'getActionName', 'setActionName', 'getCookie', 'isSecure'],
156-
[],
157-
'',
158-
false
159-
);
153+
$this->request = $this->getMockBuilder('Magento\Framework\App\Request\Http')
154+
->disableOriginalConstructor()->getMock();
160155
$this->response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false);
161156
$this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface');
162157
$this->eventManager = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false);

dev/tests/unit/testsuite/Magento/Checkout/Helper/CartTest.php

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,8 @@ class CartTest extends \PHPUnit_Framework_TestCase
5151

5252
protected function setUp()
5353
{
54-
$this->requestMock = $this->getMock(
55-
'\Magento\Framework\App\RequestInterface',
56-
[
57-
'getRouteName',
58-
'getControllerName',
59-
'getParam',
60-
'setActionName',
61-
'getActionName',
62-
'setModuleName',
63-
'getModuleName',
64-
'getCookie',
65-
'isAjax',
66-
'isSecure',
67-
]
68-
);
54+
$this->requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http')
55+
->disableOriginalConstructor()->getMock();
6956
$objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this);
7057
/** @var \Magento\Framework\App\Helper\Context $context */
7158
$context = $objectManagerHelper->getObject(

dev/tests/unit/testsuite/Magento/Checkout/Model/Type/OnepageTest.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class OnepageTest extends \PHPUnit_Framework_TestCase
4343
/** @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject */
4444
protected $storeManagerMock;
4545

46-
/** @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */
46+
/** @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject */
4747
protected $requestMock;
4848

4949
/** @var \PHPUnit_Framework_MockObject_MockObject */
@@ -132,19 +132,8 @@ protected function setUp()
132132
false
133133
);
134134
$this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface');
135-
$this->requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface')
136-
->setMethods([
137-
'isAjax',
138-
'getModuleName',
139-
'setModuleName',
140-
'getActionName',
141-
'setActionName',
142-
'getParam',
143-
'getCookie',
144-
'isSecure',
145-
])
146-
->getMock();
147-
135+
$this->requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http')
136+
->disableOriginalConstructor()->getMock();
148137
$this->addressFactoryMock = $this->getMock('Magento\Customer\Model\AddressFactory', [], [], '', false);
149138
$this->formFactoryMock = $this->getMock('Magento\Customer\Model\Metadata\FormFactory', [], [], '', false);
150139
$this->customerFactoryMock = $this->getMock('Magento\Customer\Model\CustomerFactory', [], [], '', false);

dev/tests/unit/testsuite/Magento/Customer/Controller/Account/CreateTest.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,8 @@ protected function setUp()
6363
$this->registrationMock = $this->getMock('\Magento\Customer\Model\Registration', [], [], '', false);
6464
$this->redirectMock = $this->getMock('Magento\Framework\App\Response\RedirectInterface');
6565
$this->response = $this->getMock('Magento\Framework\App\ResponseInterface');
66-
$this->request = $this->getMockBuilder('Magento\Framework\App\RequestInterface')
67-
->setMethods([
68-
'isPost',
69-
'getModuleName',
70-
'setModuleName',
71-
'getActionName',
72-
'setActionName',
73-
'getParam',
74-
'getCookie',
75-
'isSecure',
76-
])
77-
->getMock();
66+
$this->request = $this->getMockBuilder('Magento\Framework\App\Request\Http')
67+
->disableOriginalConstructor()->getMock();
7868
$this->redirectResultMock = $this->getMock('Magento\Framework\Controller\Result\Redirect', [], [], '', false);
7969

8070
$this->redirectFactoryMock = $this->getMock(

dev/tests/unit/testsuite/Magento/Customer/Controller/Account/LoginPostTest.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class LoginPostTest extends \PHPUnit_Framework_TestCase
2222
protected $object;
2323

2424
/**
25-
* @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
25+
* @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject
2626
*/
2727
protected $request;
2828

@@ -98,18 +98,8 @@ class LoginPostTest extends \PHPUnit_Framework_TestCase
9898

9999
protected function setUp()
100100
{
101-
$this->request = $this->getMockBuilder('Magento\Framework\App\RequestInterface')
102-
->setMethods([
103-
'isPost',
104-
'getModuleName',
105-
'setModuleName',
106-
'getActionName',
107-
'setActionName',
108-
'getParam',
109-
'getCookie',
110-
'isSecure',
111-
])
112-
->getMock();
101+
$this->request = $this->getMockBuilder('Magento\Framework\App\Request\Http')
102+
->disableOriginalConstructor()->getMock();
113103
$this->response = $this->getMock(
114104
'Magento\Framework\App\ResponseInterface',
115105
['setRedirect', 'sendResponse'],

dev/tests/unit/testsuite/Magento/Customer/Controller/Adminhtml/Index/IndexTest.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase
2121
protected $context;
2222

2323
/**
24-
* @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
24+
* @var \Magento\Framework\App\Request|\PHPUnit_Framework_MockObject_MockObject
2525
*/
2626
protected $requestMock;
2727

@@ -62,20 +62,8 @@ class IndexTest extends \PHPUnit_Framework_TestCase
6262

6363
protected function setUp()
6464
{
65-
$this->requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface')
66-
->setMethods(
67-
[
68-
'getQuery',
69-
'getModuleName',
70-
'setModuleName',
71-
'getActionName',
72-
'setActionName',
73-
'getParam',
74-
'getCookie',
75-
'isSecure',
76-
]
77-
)
78-
->getMock();
65+
$this->requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http')
66+
->disableOriginalConstructor()->getMock();
7967
$this->resultForwardFactoryMock = $this->getMockBuilder('Magento\Backend\Model\View\Result\ForwardFactory')
8068
->disableOriginalConstructor()
8169
->setMethods(['create'])

dev/tests/unit/testsuite/Magento/Customer/Controller/Ajax/LoginTest.php

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class LoginTest extends \PHPUnit_Framework_TestCase
2121
protected $object;
2222

2323
/**
24-
* @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
24+
* @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject
2525
*/
2626
protected $request;
2727

@@ -67,21 +67,8 @@ class LoginTest extends \PHPUnit_Framework_TestCase
6767

6868
protected function setUp()
6969
{
70-
$this->request = $this->getMockBuilder('Magento\Framework\App\RequestInterface')
71-
->setMethods([
72-
'isPost',
73-
'getModuleName',
74-
'setModuleName',
75-
'getActionName',
76-
'setActionName',
77-
'getParam',
78-
'getCookie',
79-
'getContent',
80-
'getMethod',
81-
'isXmlHttpRequest',
82-
'isSecure',
83-
])
84-
->getMock();
70+
$this->request = $this->getMockBuilder('Magento\Framework\App\Request\Http')
71+
->disableOriginalConstructor()->getMock();
8572
$this->response = $this->getMock(
8673
'Magento\Framework\App\ResponseInterface',
8774
['setRedirect', 'sendResponse', 'representJson', 'setHttpResponseCode'],

0 commit comments

Comments
 (0)