-
Notifications
You must be signed in to change notification settings - Fork 9.4k
788: Integration test rework. Introduced new extension point for New Shipment Controller to retrieve Shipment Data #14634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @maghamed, thank you for the review. |
In the scope of Pull Request magento/inventory#788 on MSI project, extension point ( The initial behavior of a Single Stock system is preserved and delivered as out-of-the-box implementation of ShipmentProviderInterface. Also, there is a slight refactoring of existing Integration tests which instantiated Shipment model via ObjectManager but not via ShipmentFactory (legal entity for Shipment creation), like this |
*/ | ||
public function __construct( | ||
Action\Context $context, | ||
\Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader $shipmentLoader | ||
\Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader $shipmentLoader, | ||
\Magento\Shipping\Model\ShipmentProviderInterface $shipmentProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, inject new dependencies according to Backward Compatible Development Guide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
/** | ||
* @inheritdoc | ||
*/ | ||
public function getShipment(): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename method to getShipmentData
because the current name may confuse developers, getShipment
in most cases means object instead of the array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
* | ||
* @return array | ||
*/ | ||
public function getShipment(): array; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename method to getShipmentData
because the current name may confuse developers, getShipment
in most cases means object instead of the array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
namespace Magento\Shipping\Model; | ||
|
||
/** | ||
* Provide shipment items data from request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better remove the request from comment as a source for shipment data because interface shouldn't contain implementation details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
interface ShipmentProviderInterface | ||
{ | ||
/** | ||
* Retrieve shipment items from request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
…oint for New Shipment Controller. #14634
Hi @nmalevanec. Thank you for your contribution. |
Description
Integration test rework and Shipment controller refactor in order to support magento/inventory#788
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist