Skip to content

Commit dc398ad

Browse files
committed
MAGETWO-55695: Remove saving order from Creditmemo repository save
1 parent b572c7a commit dc398ad

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/code/Magento/Sales/Model/Service/CreditmemoService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function refund(
160160
$this->validateForRefund($creditmemo);
161161
$creditmemo->setState(\Magento\Sales\Model\Order\Creditmemo::STATE_REFUNDED);
162162

163-
$connection = $this->getResource()->getConnectionByName('sales');
163+
$connection = $this->getResource()->getConnection('sales');
164164
$connection->beginTransaction();
165165
try {
166166
$order = $this->getPaymentAdapter()->refund(

app/code/Magento/Sales/Test/Unit/Model/Service/CreditmemoServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public function testRefund()
248248
$adapterMock = $this->getMockBuilder(\Magento\Framework\DB\Adapter\AdapterInterface::class)
249249
->disableOriginalConstructor()
250250
->getMockForAbstractClass();
251-
$resourceMock->expects($this->once())->method('getConnectionByName')->with('sales')->willReturn($adapterMock);
251+
$resourceMock->expects($this->once())->method('getConnection')->with('sales')->willReturn($adapterMock);
252252
$adapterMock->expects($this->once())->method('beginTransaction');
253253
$paymentAdapterMock->expects($this->once())
254254
->method('refund')

0 commit comments

Comments
 (0)