Skip to content

Commit 5236b37

Browse files
committed
MAGETWO-55657: Implement new service OrderInvoice
1 parent fa1def7 commit 5236b37

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

app/code/Magento/Sales/Api/Data/InvoiceCommentInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
* invoice history.
1313
* @api
1414
*/
15-
interface InvoiceCommentInterface extends
16-
\Magento\Framework\Api\ExtensibleDataInterface, \Magento\Sales\Api\Data\InvoiceCommentCreationInterface
15+
interface InvoiceCommentInterface extends \Magento\Framework\Api\ExtensibleDataInterface,
16+
\Magento\Sales\Api\Data\InvoiceCommentCreationInterface
1717
{
1818
/**#@+
1919
* Constants for keys of data array. Identical to the name of the getter in snake case.

app/code/Magento/Sales/Model/OrderInvoice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function execute(
141141
InvoiceCommentCreationInterface $comment = null,
142142
InvoiceCreationArgumentsInterface $arguments = null
143143
) {
144-
$connection = $this->resourceConnection->getConnection('sales');
144+
$connection = $this->resourceConnection->getConnectionByName('sales');
145145
$order = $this->orderRepository->get($orderId);
146146
$invoice = $this->invoiceDocumentFactory->create(
147147
$order,

app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ protected function setUp()
204204
->willReturn($this->storeMock);
205205

206206
$this->senderBuilderFactoryMock = $this->getMockBuilder(
207-
\Magento\Sales\Model\Order\Email\SenderBuilderFactory::class
207+
\Magento\Sales\Model\Order\Email\SenderBuilderFactory::class
208208
)
209209
->disableOriginalConstructor()
210210
->setMethods(['create'])

app/code/Magento/Sales/Test/Unit/Model/OrderInvoiceTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ protected function setUp()
192192
public function testOrderInvoice($orderId, $capture, $items, $notify, $appendComment)
193193
{
194194
$this->resourceConnectionMock->expects($this->once())
195-
->method('getConnection')
195+
->method('getConnectionByName')
196196
->with('sales')
197197
->willReturn($this->adapterInterface);
198198

@@ -284,9 +284,9 @@ public function testOrderInvoice($orderId, $capture, $items, $notify, $appendCom
284284
}
285285

286286
/**
287-
* @expectedException \Magento\Sales\Model\Order\SalesDocumentValidationException
287+
* @expectedException \Magento\Sales\Api\DocumentValidationException
288288
*/
289-
public function testSalesDocumentValidationException()
289+
public function testDocumentValidationException()
290290
{
291291
$orderId = 1;
292292
$capture = true;
@@ -326,17 +326,17 @@ public function testSalesDocumentValidationException()
326326
}
327327

328328
/**
329-
* @expectedException \Magento\Sales\Model\Order\SalesOperationFailedException
329+
* @expectedException \Magento\Sales\Api\CouldNotInvoiceException
330330
*/
331-
public function testSalesOperationFailedException()
331+
public function testCouldNotInvoiceException()
332332
{
333333
$orderId = 1;
334334
$items = [1 => 2];
335335
$capture = true;
336336
$notify = true;
337337
$appendComment = true;
338338
$this->resourceConnectionMock->expects($this->once())
339-
->method('getConnection')
339+
->method('getConnectionByName')
340340
->with('sales')
341341
->willReturn($this->adapterInterface);
342342

0 commit comments

Comments
 (0)