You are here

function Braintree_SubscriptionTest::testFind in Commerce Braintree 7

File

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

Class

Braintree_SubscriptionTest

Code

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