Skip to content

Commit c4e8bc0

Browse files
merge magento/2.4-develop into magento-mpi/MC-18452
2 parents b4390ed + 8628eb8 commit c4e8bc0

File tree

1 file changed

+8
-8
lines changed
  • dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create

1 file changed

+8
-8
lines changed

dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ protected function setUp()
6868
*/
6969
public function testExecuteWithPaymentOperation()
7070
{
71+
/** @var OrderService|MockObject $orderService */
72+
$orderService = $this->getMockBuilder(OrderService::class)
73+
->disableOriginalConstructor()
74+
->getMock();
75+
$orderService->method('place')
76+
->willThrowException(new LocalizedException(__('Transaction has been declined.')));
77+
$this->_objectManager->addSharedInstance($orderService, OrderService::class);
78+
7179
$quote = $this->getQuote('2000000001');
7280
$session = $this->_objectManager->get(Quote::class);
7381
$session->setQuoteId($quote->getId());
@@ -82,14 +90,6 @@ public function testExecuteWithPaymentOperation()
8290
$this->getRequest()->setMethod(Http::METHOD_POST);
8391
$this->getRequest()->setPostValue(['order' => $data]);
8492

85-
/** @var OrderService|MockObject $orderService */
86-
$orderService = $this->getMockBuilder(OrderService::class)
87-
->disableOriginalConstructor()
88-
->getMock();
89-
$orderService->method('place')
90-
->willThrowException(new LocalizedException(__('Transaction has been declined.')));
91-
$this->_objectManager->addSharedInstance($orderService, OrderService::class);
92-
9393
$this->dispatch('backend/sales/order_create/save');
9494
$this->assertSessionMessages(
9595
self::equalTo(['Transaction has been declined.']),

0 commit comments

Comments
 (0)