Skip to content

Commit f8fe776

Browse files
author
vpaladiychuk
committed
Merge remote-tracking branch 'origin/MAGETWO-31522' into MAGETWO-31522
2 parents 1a35ad6 + 72006f8 commit f8fe776

File tree

8 files changed

+18
-145
lines changed

8 files changed

+18
-145
lines changed

app/code/Magento/Sales/Controller/Adminhtml/Order/CommentsHistory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ class CommentsHistory extends \Magento\Sales\Controller\Adminhtml\Order
1616
public function execute()
1717
{
1818
$this->_initOrder();
19-
$resultPage = $this->resultPageFactory->create();
20-
$html = $resultPage->getLayout()->createBlock('Magento\Sales\Block\Adminhtml\Order\View\Tab\History')->toHtml();
19+
$resultLayout = $this->resultLayoutFactory->create();
20+
$html = $resultLayout->getLayout()
21+
->createBlock('Magento\Sales\Block\Adminhtml\Order\View\Tab\History')
22+
->toHtml();
2123
$this->_translateInline->processResponseBody($html);
2224
/** @var \Magento\Framework\Controller\Result\Raw $resultRaw */
2325
$resultRaw = $this->resultRawFactory->create();
2426
$resultRaw->setContents($html);
25-
2627
return $resultRaw;
2728
}
2829
}

app/code/Magento/Sales/Controller/Adminhtml/Order/ExportCsv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function execute()
2020
{
2121
$fileName = 'orders.csv';
2222
/** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */
23-
$exportBlock = $this->resultLayoutFactory->create()
23+
$exportBlock = $this->resultPageFactory->create()
2424
->getLayout()
2525
->getChildBlock('sales.order.grid', 'grid.export');
2626
return $this->_fileFactory->create($fileName, $exportBlock->getCsvFile(), DirectoryList::VAR_DIR);

app/code/Magento/Sales/Controller/Adminhtml/Order/ExportExcel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function execute()
2020
{
2121
$fileName = 'orders.xml';
2222
/** @var \Magento\Backend\Block\Widget\Grid\ExportInterface $exportBlock */
23-
$exportBlock = $this->resultLayoutFactory->create()
23+
$exportBlock = $this->resultPageFactory->create()
2424
->getLayout()
2525
->getChildBlock('sales.order.grid', 'grid.export');
2626
return $this->_fileFactory->create($fileName, $exportBlock->getExcelFile($fileName), DirectoryList::VAR_DIR);

app/code/Magento/Sales/Controller/Adminhtml/Order/Grid.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,6 @@
77

88
class Grid extends \Magento\Sales\Controller\Adminhtml\Order
99
{
10-
/**
11-
* @var \Magento\Framework\View\Result\LayoutFactory
12-
*/
13-
protected $resultLayoutFactory;
14-
15-
/**
16-
* @param \Magento\Backend\App\Action\Context $context
17-
* @param \Magento\Framework\Registry $coreRegistry
18-
* @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory
19-
* @param \Magento\Framework\Translate\InlineInterface $translateInline
20-
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
21-
* @param \Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory
22-
* @param \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
23-
*/
24-
public function __construct(
25-
\Magento\Backend\App\Action\Context $context,
26-
\Magento\Framework\Registry $coreRegistry,
27-
\Magento\Framework\App\Response\Http\FileFactory $fileFactory,
28-
\Magento\Framework\Translate\InlineInterface $translateInline,
29-
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
30-
\Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory,
31-
\Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
32-
) {
33-
$this->resultLayoutFactory = $resultLayoutFactory;
34-
parent::__construct(
35-
$context,
36-
$coreRegistry,
37-
$fileFactory,
38-
$translateInline,
39-
$resultPageFactory,
40-
$resultRedirectFactory
41-
);
42-
}
43-
4410
/**
4511
* Order grid
4612
*

app/code/Magento/Sales/Controller/Adminhtml/Order/Invoices.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,6 @@
77

88
class Invoices extends \Magento\Sales\Controller\Adminhtml\Order
99
{
10-
/**
11-
* @var \Magento\Framework\View\Result\LayoutFactory
12-
*/
13-
protected $resultLayoutFactory;
14-
15-
/**
16-
* @param \Magento\Backend\App\Action\Context $context
17-
* @param \Magento\Framework\Registry $coreRegistry
18-
* @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory
19-
* @param \Magento\Framework\Translate\InlineInterface $translateInline
20-
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
21-
* @param \Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory
22-
* @param \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
23-
*/
24-
public function __construct(
25-
\Magento\Backend\App\Action\Context $context,
26-
\Magento\Framework\Registry $coreRegistry,
27-
\Magento\Framework\App\Response\Http\FileFactory $fileFactory,
28-
\Magento\Framework\Translate\InlineInterface $translateInline,
29-
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
30-
\Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory,
31-
\Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
32-
) {
33-
$this->resultLayoutFactory = $resultLayoutFactory;
34-
parent::__construct(
35-
$context,
36-
$coreRegistry,
37-
$fileFactory,
38-
$translateInline,
39-
$resultPageFactory,
40-
$resultRedirectFactory
41-
);
42-
}
43-
4410
/**
4511
* Generate invoices grid for ajax request
4612
*

app/code/Magento/Sales/Controller/Adminhtml/Order/Shipments.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,6 @@
77

88
class Shipments extends \Magento\Sales\Controller\Adminhtml\Order
99
{
10-
/**
11-
* @var \Magento\Framework\View\Result\LayoutFactory
12-
*/
13-
protected $resultLayoutFactory;
14-
15-
/**
16-
* @param \Magento\Backend\App\Action\Context $context
17-
* @param \Magento\Framework\Registry $coreRegistry
18-
* @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory
19-
* @param \Magento\Framework\Translate\InlineInterface $translateInline
20-
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
21-
* @param \Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory
22-
* @param \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
23-
*/
24-
public function __construct(
25-
\Magento\Backend\App\Action\Context $context,
26-
\Magento\Framework\Registry $coreRegistry,
27-
\Magento\Framework\App\Response\Http\FileFactory $fileFactory,
28-
\Magento\Framework\Translate\InlineInterface $translateInline,
29-
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
30-
\Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory,
31-
\Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
32-
) {
33-
$this->resultLayoutFactory = $resultLayoutFactory;
34-
parent::__construct(
35-
$context,
36-
$coreRegistry,
37-
$fileFactory,
38-
$translateInline,
39-
$resultPageFactory,
40-
$resultRedirectFactory
41-
);
42-
}
43-
4410
/**
4511
* Generate shipments grid for ajax request
4612
*

app/code/Magento/Sales/Controller/Adminhtml/Order/Transactions.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,6 @@
99

1010
class Transactions extends \Magento\Sales\Controller\Adminhtml\Order
1111
{
12-
/**
13-
* @var \Magento\Framework\View\Result\LayoutFactory
14-
*/
15-
protected $resultLayoutFactory;
16-
17-
/**
18-
* @param \Magento\Backend\App\Action\Context $context
19-
* @param \Magento\Framework\Registry $coreRegistry
20-
* @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory
21-
* @param \Magento\Framework\Translate\InlineInterface $translateInline
22-
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
23-
* @param \Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory
24-
* @param \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
25-
*/
26-
public function __construct(
27-
\Magento\Backend\App\Action\Context $context,
28-
\Magento\Framework\Registry $coreRegistry,
29-
\Magento\Framework\App\Response\Http\FileFactory $fileFactory,
30-
\Magento\Framework\Translate\InlineInterface $translateInline,
31-
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
32-
\Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory,
33-
\Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
34-
) {
35-
$this->resultLayoutFactory = $resultLayoutFactory;
36-
parent::__construct(
37-
$context,
38-
$coreRegistry,
39-
$fileFactory,
40-
$translateInline,
41-
$resultPageFactory,
42-
$resultRedirectFactory
43-
);
44-
}
45-
4612
/**
4713
* Order transactions grid ajax action
4814
*

dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Order/EmailTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,13 @@ public function testEmail()
193193
->with('You sent the order email.');
194194
$this->resultRedirect->expects($this->once())
195195
->method('setPath')
196-
->with('sales/order/view', ['order_id' => $orderId]);
196+
->with('sales/order/view', ['order_id' => $orderId])
197+
->willReturnSelf();
197198

198-
$this->orderEmail->execute();
199+
$this->assertInstanceOf(
200+
'Magento\Backend\Model\View\Result\Redirect',
201+
$this->orderEmail->execute()
202+
);
199203
$this->assertEquals($this->response, $this->orderEmail->getResponse());
200204
}
201205

@@ -226,8 +230,12 @@ public function testEmailNoOrderId()
226230
->will($this->returnValue(true));
227231
$this->resultRedirect->expects($this->once())
228232
->method('setPath')
229-
->with('sales/*/');
233+
->with('sales/*/')
234+
->willReturnSelf();
230235

231-
$this->assertNull($this->orderEmail->execute());
236+
$this->assertInstanceOf(
237+
'Magento\Backend\Model\View\Result\Redirect',
238+
$this->orderEmail->execute()
239+
);
232240
}
233241
}

0 commit comments

Comments
 (0)