Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 25ee332

Browse files
committed
788: Integration test rework. Shipment controller refactor.
1 parent a1db922 commit 25ee332

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/NewAction.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Shipping\Controller\Adminhtml\Order\Shipment;
88

99
use Magento\Backend\App\Action;
10+
use Magento\Framework\App\ObjectManager;
1011

1112
class NewAction extends \Magento\Backend\App\Action
1213
{
@@ -35,10 +36,11 @@ class NewAction extends \Magento\Backend\App\Action
3536
public function __construct(
3637
Action\Context $context,
3738
\Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader $shipmentLoader,
38-
\Magento\Shipping\Model\ShipmentProviderInterface $shipmentProvider
39+
\Magento\Shipping\Model\ShipmentProviderInterface $shipmentProvider = null
3940
) {
4041
$this->shipmentLoader = $shipmentLoader;
41-
$this->shipmentProvider = $shipmentProvider;
42+
$this->shipmentProvider = $shipmentProvider ?: ObjectManager::getInstance()
43+
->get(\Magento\Shipping\Model\ShipmentProviderInterface::class);
4244
parent::__construct($context);
4345
}
4446

app/code/Magento/Shipping/Model/ShipmentProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(RequestInterface $request)
3030
/**
3131
* @inheritdoc
3232
*/
33-
public function getShipment(): array
33+
public function getShipmentData(): array
3434
{
3535
return $this->request->getParam('shipment', []);
3636
}

app/code/Magento/Shipping/Model/ShipmentProviderInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
namespace Magento\Shipping\Model;
99

1010
/**
11-
* Provide shipment items data from request.
11+
* Provide shipment items data.
1212
*
1313
* @api
1414
*/
1515
interface ShipmentProviderInterface
1616
{
1717
/**
18-
* Retrieve shipment items from request.
18+
* Retrieve shipment items.
1919
*
2020
* @return array
2121
*/
22-
public function getShipment(): array;
22+
public function getShipmentData(): array;
2323
}

0 commit comments

Comments
 (0)