You are here

public function PaymentMethodBaseTest::testExecutePayment in Payment 8.2

@covers ::executePayment @covers ::doExecutePayment

File

tests/src/Unit/Plugin/Payment/Method/PaymentMethodBaseTest.php, line 201

Class

PaymentMethodBaseTest
@coversDefaultClass \Drupal\payment\Plugin\Payment\Method\PaymentMethodBase

Namespace

Drupal\Tests\payment\Unit\Plugin\Payment\Method

Code

public function testExecutePayment() {
  $payment_status = $this
    ->createMock(PaymentStatusInterface::class);
  $this->paymentStatusManager
    ->expects($this
    ->atLeastOnce())
    ->method('createInstance')
    ->with('payment_pending')
    ->willReturn($payment_status);
  $payment = $this
    ->getMockPayment();
  $this->eventDispatcher
    ->expects($this
    ->once())
    ->method('preExecutePayment')
    ->with($payment);
  $this->sut
    ->setPayment($payment);
  $this->sut
    ->executePayment();
}