Dumplie\CustomerService\Tests\Integration\Application\Generic\PaymentTestCase::test_pay_payment PHP Method

test_pay_payment() public method

public test_pay_payment ( )
    function test_pay_payment()
    {
        $orderId = OrderId::generate();
        $this->customerServiceContext->customerPlacedOrder((string) $orderId);
        $paymentId = $this->customerServiceContext->createPaymentFor($orderId);
        $command = new PayPayment((string) $paymentId);
        $this->customerServiceContext->commandBus()->handle($command);
        $this->clear();
        $payment = $this->customerServiceContext->payments()->getById($paymentId);
        $this->assertTrue($payment->isPaid());
    }