Skip to content

Commit 7ebd209

Browse files
author
Stanislav Idolov
committed
MAGETWO-63275: Fixing Recently ordered block and optimize reorder functionality
1 parent c3472b4 commit 7ebd209

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

app/code/Magento/Sales/Test/Unit/Model/OrderTest.php

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ class OrderTest extends \PHPUnit_Framework_TestCase
7373
*/
7474
protected $productCollectionFactoryMock;
7575

76-
/**
77-
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
78-
*/
7976
protected function setUp()
8077
{
8178
$helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
@@ -140,18 +137,10 @@ protected function setUp()
140137
'',
141138
false
142139
);
143-
$collection->expects($this->any())
144-
->method('setOrderFilter')
145-
->willReturnSelf();
146-
$collection->expects($this->any())
147-
->method('getItems')
148-
->willReturn([$this->item]);
149-
$collection->expects($this->any())
150-
->method('getIterator')
151-
->willReturn(new \ArrayIterator([$this->item]));
152-
$this->orderItemCollectionFactoryMock->expects($this->any())
153-
->method('create')
154-
->willReturn($collection);
140+
$collection->expects($this->any())->method('setOrderFilter')->willReturnSelf();
141+
$collection->expects($this->any())->method('getItems')->willReturn([$this->item]);
142+
$collection->expects($this->any())->method('getIterator')->willReturn(new \ArrayIterator([$this->item]));
143+
$this->orderItemCollectionFactoryMock->expects($this->any())->method('create')->willReturn($collection);
155144

156145
$this->priceCurrency = $this->getMockForAbstractClass(
157146
\Magento\Framework\Pricing\PriceCurrencyInterface::class,
@@ -162,14 +151,10 @@ protected function setUp()
162151
true,
163152
['round']
164153
);
165-
166154
$this->incrementId = '#00000001';
167155
$this->eventManager = $this->getMock(\Magento\Framework\Event\Manager::class, [], [], '', false);
168156
$context = $this->getMock(\Magento\Framework\Model\Context::class, ['getEventDispatcher'], [], '', false);
169-
$context->expects($this->any())
170-
->method('getEventDispatcher')
171-
->willReturn($this->eventManager);
172-
157+
$context->expects($this->any())->method('getEventDispatcher')->willReturn($this->eventManager);
173158
$this->order = $helper->getObject(
174159
\Magento\Sales\Model\Order::class,
175160
[

0 commit comments

Comments
 (0)