Skip to content

Commit 0246abe

Browse files
author
Dmytro Poperechnyy
committed
MAGETWO-34995: Refactor controllers from the list (Part2)
- Failed static tests fixed;
1 parent 4573c0e commit 0246abe

File tree

3 files changed

+12
-22
lines changed

3 files changed

+12
-22
lines changed

app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/EmailTest.php

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Class EmailTest
1616
*
1717
* @package Magento\Shipping\Controller\Adminhtml\Order\Shipment
18+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1819
*/
1920
class EmailTest extends \PHPUnit_Framework_TestCase
2021
{
@@ -149,30 +150,18 @@ public function setUp()
149150
false
150151
);
151152
$this->resultRedirectFactory->expects($this->once())->method('create')->willReturn($this->resultRedirect);
152-
$this->context->expects($this->once())
153-
->method('getMessageManager')
154-
->will($this->returnValue($this->messageManager));
155-
$this->context->expects($this->once())
156-
->method('getRequest')
157-
->will($this->returnValue($this->request));
158-
$this->context->expects($this->once())
159-
->method('getResponse')
160-
->will($this->returnValue($this->response));
161-
$this->context->expects($this->once())
162-
->method('getObjectManager')
163-
->will($this->returnValue($this->objectManager));
164-
$this->context->expects($this->once())
165-
->method('getSession')
166-
->will($this->returnValue($this->session));
167-
$this->context->expects($this->once())
168-
->method('getActionFlag')
169-
->will($this->returnValue($this->actionFlag));
170-
$this->context->expects($this->once())
171-
->method('getHelper')
172-
->will($this->returnValue($this->helper));
153+
154+
$this->context->expects($this->once())->method('getMessageManager')->willReturn($this->messageManager);
155+
$this->context->expects($this->once())->method('getRequest')->willReturn($this->request);
156+
$this->context->expects($this->once())->method('getResponse')->willReturn($this->response);
157+
$this->context->expects($this->once())->method('getObjectManager')->willReturn($this->objectManager);
158+
$this->context->expects($this->once())->method('getSession')->willReturn($this->session);
159+
$this->context->expects($this->once())->method('getActionFlag')->willReturn($this->actionFlag);
160+
$this->context->expects($this->once())->method('getHelper')->willReturn($this->helper);
173161
$this->context->expects($this->once())
174162
->method('getResultRedirectFactory')
175163
->willReturn($this->resultRedirectFactory);
164+
176165
$this->shipmentEmail = $objectManagerHelper->getObject(
177166
'Magento\Shipping\Controller\Adminhtml\Order\Shipment\Email',
178167
[

app/code/Magento/Tax/Controller/Adminhtml/Rate/Delete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ public function getDefaultRedirect()
5050
}
5151
return $resultRedirect;
5252
}
53-
}
53+
}

app/code/Magento/Wishlist/Controller/Index/Fromcart.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function __construct(
3535
* @return \Magento\Framework\Controller\Result\Redirect
3636
* @throws NotFoundException
3737
* @throws \Magento\Framework\Exception\LocalizedException
38+
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
3839
*/
3940
public function execute()
4041
{

0 commit comments

Comments
 (0)