Skip to content

Commit e4d028c

Browse files
committed
MAGETWO-32340: [GITHUB] Add getParams and setParams to App\RequestInterface #865 #1053
Merge branch '865-add-getParams-setParams-to-request-interface' of git://github.com/ashsmith/magento2 into ashsmith-865-add-getParams-setParams-to-request-interface Conflicts: dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/SaveTest.php dev/tests/unit/testsuite/Magento/Checkout/Helper/CartTest.php dev/tests/unit/testsuite/Magento/Checkout/Model/Type/OnepageTest.php dev/tests/unit/testsuite/Magento/Customer/Controller/Account/CreateTest.php dev/tests/unit/testsuite/Magento/Customer/Controller/Account/LoginPostTest.php dev/tests/unit/testsuite/Magento/Customer/Controller/Adminhtml/Index/IndexTest.php dev/tests/unit/testsuite/Magento/Customer/Controller/Ajax/LoginTest.php dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/FileTest.php dev/tests/unit/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/Product/Edit/LinkTest.php dev/tests/unit/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/Product/Edit/SampleTest.php dev/tests/unit/testsuite/Magento/Downloadable/Controller/Download/LinkTest.php dev/tests/unit/testsuite/Magento/Framework/App/Action/ActionTest.php dev/tests/unit/testsuite/Magento/Framework/App/Router/NoRouteHandlerTest.php dev/tests/unit/testsuite/Magento/Framework/Controller/Result/ForwardTest.php dev/tests/unit/testsuite/Magento/Framework/UrlTest.php
2 parents 4e46722 + ffbeaeb commit e4d028c

File tree

28 files changed

+122
-393
lines changed

28 files changed

+122
-393
lines changed

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 */
@@ -151,13 +151,8 @@ protected function prepareContext()
151151
->disableOriginalConstructor()
152152
->getMock();
153153

154-
$this->request = $this->getMock(
155-
'Magento\Framework\App\RequestInterface',
156-
['getParam', 'getModuleName', 'setModuleName', 'getActionName', 'setActionName', 'getCookie', 'isSecure'],
157-
[],
158-
'',
159-
false
160-
);
154+
$this->request = $this->getMockBuilder('Magento\Framework\App\Request\Http')
155+
->disableOriginalConstructor()->getMock();
161156
$this->response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false);
162157
$this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface');
163158
$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

@@ -103,18 +103,8 @@ class LoginPostTest extends \PHPUnit_Framework_TestCase
103103

104104
protected function setUp()
105105
{
106-
$this->request = $this->getMockBuilder('Magento\Framework\App\RequestInterface')
107-
->setMethods([
108-
'isPost',
109-
'getModuleName',
110-
'setModuleName',
111-
'getActionName',
112-
'setActionName',
113-
'getParam',
114-
'getCookie',
115-
'isSecure',
116-
])
117-
->getMock();
106+
$this->request = $this->getMockBuilder('Magento\Framework\App\Request\Http')
107+
->disableOriginalConstructor()->getMock();
118108
$this->response = $this->getMock(
119109
'Magento\Framework\App\ResponseInterface',
120110
['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'],

dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/FileTest.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class FileTest extends AbstractFormTestCase
2121
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Filesystem */
2222
protected $fileSystemMock;
2323

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

2727
/**
@@ -38,20 +38,8 @@ protected function setUp()
3838
->disableOriginalConstructor()->getMock();
3939
$this->fileSystemMock = $this->getMockBuilder('Magento\Framework\Filesystem')
4040
->disableOriginalConstructor()->getMock();
41-
$this->requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface')
42-
->setMethods(
43-
[
44-
'getParam',
45-
'getParams',
46-
'getModuleName',
47-
'setModuleName',
48-
'getActionName',
49-
'setActionName',
50-
'getCookie',
51-
'isSecure',
52-
]
53-
)
54-
->getMock();
41+
$this->requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http')
42+
->disableOriginalConstructor()->getMock();
5543
$this->uploaderFactoryMock = $this->getMock('Magento\Framework\File\UploaderFactory', [], [], '', false);
5644
}
5745

dev/tests/unit/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/Product/Edit/LinkTest.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase
1717
protected $objectManagerHelper;
1818

1919
/**
20-
* @var \Magento\Framework\App\RequestInterface
20+
* @var \Magento\Framework\App\Request\Http
2121
*/
2222
protected $request;
2323

@@ -50,18 +50,8 @@ protected function setUp()
5050
{
5151
$this->objectManagerHelper = new ObjectManagerHelper($this);
5252

53-
$this->request = $this->getMock(
54-
'Magento\Framework\App\RequestInterface',
55-
[
56-
'getParam',
57-
'getModuleName',
58-
'setModuleName',
59-
'getActionName',
60-
'setActionName',
61-
'getCookie',
62-
'isSecure',
63-
]
64-
);
53+
$this->request = $this->getMockBuilder('Magento\Framework\App\Request\Http')
54+
->disableOriginalConstructor()->getMock();
6555
$this->response = $this->getMock(
6656
'\Magento\Framework\App\ResponseInterface',
6757
[

dev/tests/unit/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/Product/Edit/SampleTest.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SampleTest extends \PHPUnit_Framework_TestCase
1717
protected $objectManagerHelper;
1818

1919
/**
20-
* @var \Magento\Framework\App\RequestInterface
20+
* @var \Magento\Framework\App\Request\Http
2121
*/
2222
protected $request;
2323

@@ -50,18 +50,8 @@ protected function setUp()
5050
{
5151
$this->objectManagerHelper = new ObjectManagerHelper($this);
5252

53-
$this->request = $this->getMock(
54-
'Magento\Framework\App\RequestInterface',
55-
[
56-
'getParam',
57-
'getModuleName',
58-
'setModuleName',
59-
'getActionName',
60-
'setActionName',
61-
'getCookie',
62-
'isSecure',
63-
]
64-
);
53+
$this->request = $this->getMockBuilder('Magento\Framework\App\Request\Http')
54+
->disableOriginalConstructor()->getMock();
6555
$this->response = $this->getMock(
6656
'\Magento\Framework\App\ResponseInterface',
6757
[

0 commit comments

Comments
 (0)