Skip to content

Commit

Permalink
Merge pull request #188 from michielgerritsen/bugfix/cancel-order
Browse files Browse the repository at this point in the history
Bugfix: A canceled order would result in an exception
  • Loading branch information
Marvin-Magmodules authored Aug 9, 2019
2 parents 0a72757 + 67b0687 commit 07c2131
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Helper/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ public function registerCancellation(OrderInterface $order, $status = null)
$this->addTolog('info', $order->getIncrementId() . ' ' . $comment);
$this->orderCommentHistory->add($order, $comment);
$order->getPayment()->setMessage($comment);
$this->orderManagement->cancel($order);
$this->orderManagement->cancel($order->getId());

if ($order->getCouponCode()) {
$this->resetCouponAfterCancellation($order);
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Helper/GeneralTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function testRegisterCancellationReturnsFalseWhenAlreadyCanceled()
public function testRegisterCancellationCancelsTheOrder()
{
$orderManagementMock = $this->createMock(OrderManagementInterface::class);
$orderManagementMock->expects($this->once())->method('cancel');
$orderManagementMock->expects($this->once())->method('cancel')->with(999);

/** @var OrderModel $order */
$order = $this->createPartialMock(OrderModel::class, ['cancel']);
Expand Down

0 comments on commit 07c2131

Please sign in to comment.