Skip to content

Commit

Permalink
MAGETWO-40497: Prepare PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Logvin committed Aug 6, 2015
1 parent 6f065d7 commit 467603a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Sales/Model/Order/Payment/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ public function beforeSave()
if (!$this->getOrderId() && $this->getOrder()) {
$this->setOrderId($this->getOrder()->getId());
}
if (!$this->getPaymentId() && $this->getOrder()) {
if (!$this->getPaymentId() && $this->getOrder() && $this->getOrder()->getPayment()) {
$this->setPaymentId($this->getOrder()->getPayment()->getId());
}
// set parent id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@ class CreditmemoEmailTest extends WebapiAbstract
*/
public function testCreditmemoEmail()
{
$this->markTestSkipped('You can not cancel Credit Memo');
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();

/** @var \Magento\Sales\Model\Resource\Order\Creditmemo\Collection $creditmemoCollection */
$creditmemoCollection = $objectManager->get('Magento\Sales\Model\Resource\Order\Creditmemo\Collection');
$creditmemo = $creditmemoCollection->getFirstItem();
$serviceInfo = [
'rest' => [
'resourcePath' => '/V1/creditmemo/' . $creditmemo->getId(),
'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_PUT,
'resourcePath' => '/V1/creditmemo/' . $creditmemo->getId() . '/emails',
'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST,
],
'soap' => [
'service' => self::SERVICE_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
/** @var \Magento\Sales\Model\Order $order */

$orderService = \Magento\TestFramework\ObjectManager::getInstance()->create(
'Magento\Sales\Api\InvoiceManagementInterface',
['order' => $order]
'Magento\Sales\Api\InvoiceManagementInterface'
);
$invoice = $orderService->prepareInvoice($order->getEntityId());
$invoice->register();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
/** @var \Magento\Sales\Model\Order $order */

$orderService = \Magento\TestFramework\ObjectManager::getInstance()->create(
'Magento\Sales\Api\InvoiceManagementInterface',
['order' => $order]
'Magento\Sales\Api\InvoiceManagementInterface'
);
$invoice = $orderService->prepareInvoice($order->getEntityId());
$invoice->register();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
/** @var \Magento\Sales\Model\Order $order */

$orderService = \Magento\TestFramework\ObjectManager::getInstance()->create(
'Magento\Sales\Api\InvoiceManagementInterface',
['order' => $order]
'Magento\Sales\Api\InvoiceManagementInterface'
);
$invoice = $orderService->prepareInvoice($order->getEntityId());
/** To allow invoice cancelling it should be created without capturing. */
Expand Down

0 comments on commit 467603a

Please sign in to comment.