$this->customerRepository =
$this->
getRepository(CustomerDefinition::ENTITY_NAME
);
$this->orderTransactionRepository =
$this->
getRepository(OrderTransactionDefinition::ENTITY_NAME
);
$this->paymentMethodRepository =
$this->
getRepository(PaymentMethodDefinition::ENTITY_NAME
);
$this->stateMachineRepository =
$this->
getRepository(StateMachineDefinition::ENTITY_NAME
);
$this->stateMachineStateRepository =
$this->
getRepository(StateMachineStateDefinition::ENTITY_NAME
);
$this->context = Context::
createDefaultContext();
} public function testHandlePaymentByOrderWithInvalidOrderId(): void
{ $orderId = Uuid::
randomHex();
$salesChannelContext = Generator::
createSalesChannelContext();
if (!Feature::
isActive('v6.6.0.0'
)) { $this->
expectException(InvalidOrderException::
class);
} $this->
expectException(PaymentException::
class);
$this->
expectExceptionMessage(sprintf('The order with id %s is invalid or could not be found.',
$orderId));
$this->paymentService->
handlePaymentByOrder($orderId,
new RequestDataBag(),
$salesChannelContext);
} public function testHandlePaymentByOrderSyncPayment(): void
{