function Braintree_SubscriptionTest::testCreate_doesNotInheritAddOnsAndDiscountsWhenDoNotInheritAddOnsOrDiscountsIsSet in Commerce Braintree 7
File
- braintree_php/
tests/ integration/ SubscriptionTest.php, line 320
Class
Code
function testCreate_doesNotInheritAddOnsAndDiscountsWhenDoNotInheritAddOnsOrDiscountsIsSet() {
$creditCard = Braintree_SubscriptionTestHelper::createCreditCard();
$plan = Braintree_SubscriptionTestHelper::addOnDiscountPlan();
$result = Braintree_Subscription::create(array(
'paymentMethodToken' => $creditCard->token,
'planId' => $plan['id'],
'options' => array(
'doNotInheritAddOnsOrDiscounts' => true,
),
));
$subscription = $result->subscription;
$this
->assertEquals(0, sizeof($subscription->addOns));
$this
->assertEquals(0, sizeof($subscription->discounts));
}