You are here

public function RecurringOrderManagerTest::testCloseOrderWithoutPaymentMethod in Commerce Recurring Framework 8

@covers ::renewOrder

File

tests/src/Kernel/RecurringOrderManagerTest.php, line 302

Class

RecurringOrderManagerTest
@coversDefaultClass \Drupal\commerce_recurring\RecurringOrderManager @group commerce_recurring

Namespace

Drupal\Tests\commerce_recurring\Kernel

Code

public function testCloseOrderWithoutPaymentMethod() {
  $this->activeSubscription
    ->set('payment_method', NULL);
  $this->activeSubscription
    ->save();
  $order = $this->recurringOrderManager
    ->startRecurring($this->activeSubscription);
  $this
    ->expectException(HardDeclineException::class);
  $this
    ->expectExceptionMessage('Payment method not found.');
  $this->recurringOrderManager
    ->closeOrder($order);
}