You are here

function Braintree_SubscriptionTest::testUpdate_whenSuccessful in Commerce Braintree 7

File

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

Class

Braintree_SubscriptionTest

Code

function testUpdate_whenSuccessful() {
  $subscription = Braintree_SubscriptionTestHelper::createSubscription();
  $newId = strval(rand());
  $newPlan = Braintree_SubscriptionTestHelper::trialPlan();
  $result = Braintree_Subscription::update($subscription->id, array(
    'id' => $newId,
    'price' => '999.99',
    'planId' => $newPlan['id'],
  ));
  $this
    ->assertTrue($result->success);
  $this
    ->assertEquals($newId, $result->subscription->id);
  $this
    ->assertEquals($newPlan['id'], $result->subscription->planId);
  $this
    ->assertEquals('999.99', $result->subscription->price);
}