You are here

public function RecurringOrderManagerTest::testStartTrialWithInvalidBillingSchedule in Commerce Recurring Framework 8

@covers ::startTrial

File

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

Class

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

Namespace

Drupal\Tests\commerce_recurring\Kernel

Code

public function testStartTrialWithInvalidBillingSchedule() {
  $configuration = $this->billingSchedule
    ->getPluginConfiguration();
  unset($configuration['trial_interval']);
  $this->billingSchedule
    ->setPluginConfiguration($configuration);
  $this->billingSchedule
    ->save();
  $this
    ->expectException(\InvalidArgumentException::class);
  $this
    ->expectExceptionMessage('The billing schedule "test_id" does not allow trials.');
  $order = $this->recurringOrderManager
    ->startTrial($this->trialSubscription);
}