Skip to content

Commit 74ffaf3

Browse files
committed
Fix static test
1 parent 8928539 commit 74ffaf3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/code/Magento/Sales/Controller/AbstractController/Reorder.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
/**
1818
* Abstract class for controllers Reorder(Customer) and Reorder(Guest)
19-
*
20-
* Class Magento\Sales\Controller\AbstractController\Reorder
2119
*/
2220
abstract class Reorder extends Action\Action implements HttpPostActionInterface
2321
{

app/code/Magento/Sales/Test/Unit/Controller/Guest/ReorderTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,23 @@ protected function setUp()
113113
*/
114114
public function testExecuteWithReorderIsNotAllowed()
115115
{
116+
$orderMock = $this->createMock(Order::class);
117+
$orderMock->method('getId')->willReturn(self::STUB_ORDER_ID);
118+
116119
$this->orderLoaderMock->method('load')
117120
->with($this->requestMock)
118121
->willReturn($this->resultRedirectFactoryMock);
119-
$orderMock = $this->createMock(Order::class);
120-
$orderMock->method('getId')->willReturn(self::STUB_ORDER_ID);
122+
121123
$this->registryMock->expects($this->once())->method('registry')
122124
->with('current_order')
123125
->willReturn($orderMock);
124126

127+
$this->reorderHelperMock->method('canReorder')->with(self::STUB_ORDER_ID)
128+
->willReturn(false);
129+
125130
$resultRedirectMock = $this->createMock(Redirect::class);
126131
$this->resultRedirectFactoryMock->expects($this->once())->method('create')->willReturn($resultRedirectMock);
132+
127133
$this->reorderHelperMock->method('canReorder')->with(self::STUB_ORDER_ID)
128134
->willReturn(false);
129135

0 commit comments

Comments
 (0)