You are here

function Braintree_SubscriptionTest::testCreate_canSetTheId in Commerce Braintree 7

File

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

Class

Braintree_SubscriptionTest

Code

function testCreate_canSetTheId() {
  $creditCard = Braintree_SubscriptionTestHelper::createCreditCard();
  $newId = strval(rand());
  $plan = Braintree_SubscriptionTestHelper::triallessPlan();
  $result = Braintree_Subscription::create(array(
    'paymentMethodToken' => $creditCard->token,
    'planId' => $plan['id'],
    'id' => $newId,
  ));
  $this
    ->assertTrue($result->success);
  $subscription = $result->subscription;
  $this
    ->assertEquals($newId, $subscription->id);
}