Dumplie\CustomerService\Tests\CustomerServiceContext::createPaymentFor PHP Method

createPaymentFor() public method

public createPaymentFor ( OrderId $orderId ) : PaymentId
$orderId Dumplie\CustomerService\Domain\OrderId
return Dumplie\CustomerService\Domain\PaymentId
    public function createPaymentFor(OrderId $orderId) : PaymentId;

Usage Example

Beispiel #1
0
 function test_reject_payment()
 {
     $orderId = OrderId::generate();
     $this->customerServiceContext->customerPlacedOrder((string) $orderId);
     $paymentId = $this->customerServiceContext->createPaymentFor($orderId);
     $command = new RejectPayment((string) $paymentId);
     $this->customerServiceContext->commandBus()->handle($command);
     $this->clear();
     $payment = $this->customerServiceContext->payments()->getById($paymentId);
     $this->assertTrue($payment->isRejected());
 }