You are here

function Braintree_SubscriptionTest::testUpdate_canUpdateNumberOfBillingCyclesToNeverExpire in Commerce Braintree 7

File

braintree_php/tests/integration/SubscriptionTest.php, line 657

Class

Braintree_SubscriptionTest

Code

function testUpdate_canUpdateNumberOfBillingCyclesToNeverExpire() {
  $plan = Braintree_SubscriptionTestHelper::triallessPlan();
  $subscription = Braintree_SubscriptionTestHelper::createSubscription();
  $this
    ->assertEquals($plan['numberOfBillingCycles'], $subscription->numberOfBillingCycles);
  $updatedSubscription = Braintree_Subscription::update($subscription->id, array(
    'neverExpires' => true,
  ))->subscription;
  $this
    ->assertNull($updatedSubscription->numberOfBillingCycles);
}