You are here

function Braintree_MultipleValueNodeTest::testIn_multipleValues in Commerce Braintree 7

File

braintree_php/tests/integration/MultipleValueNodeTest.php, line 63

Class

Braintree_MultipleValueNodeTest

Code

function testIn_multipleValues() {
  $creditCard = Braintree_SubscriptionTestHelper::createCreditCard();
  $triallessPlan = Braintree_SubscriptionTestHelper::triallessPlan();
  $activeSubscription = Braintree_Subscription::create(array(
    'paymentMethodToken' => $creditCard->token,
    'planId' => $triallessPlan['id'],
    'price' => '4',
  ))->subscription;
  $canceledSubscription = Braintree_Subscription::create(array(
    'paymentMethodToken' => $creditCard->token,
    'planId' => $triallessPlan['id'],
    'price' => '4',
  ))->subscription;
  Braintree_Subscription::cancel($canceledSubscription->id);
  $collection = Braintree_Subscription::search(array(
    Braintree_SubscriptionSearch::status()
      ->in(array(
      Braintree_Subscription::ACTIVE,
      Braintree_Subscription::CANCELED,
    )),
    Braintree_SubscriptionSearch::price()
      ->is('4'),
  ));
  $this
    ->assertTrue(Braintree_TestHelper::includes($collection, $activeSubscription));
  $this
    ->assertTrue(Braintree_TestHelper::includes($collection, $canceledSubscription));
}