You are here

function Braintree_TextNodeTest::testIsNot in Commerce Braintree 7

Same name in this branch
  1. 7 braintree_php/tests/unit/TextNodeTest.php \Braintree_TextNodeTest::testIsNot()
  2. 7 braintree_php/tests/integration/TextNodeTest.php \Braintree_TextNodeTest::testIsNot()

File

braintree_php/tests/integration/TextNodeTest.php, line 34

Class

Braintree_TextNodeTest

Code

function testIsNot() {
  $creditCard = Braintree_SubscriptionTestHelper::createCreditCard();
  $triallessPlan = Braintree_SubscriptionTestHelper::triallessPlan();
  $trialPlan = Braintree_SubscriptionTestHelper::trialPlan();
  $trialSubscription = Braintree_Subscription::create(array(
    'paymentMethodToken' => $creditCard->token,
    'planId' => $trialPlan['id'],
    'price' => '6',
  ))->subscription;
  $triallessSubscription = Braintree_Subscription::create(array(
    'paymentMethodToken' => $creditCard->token,
    'planId' => $triallessPlan['id'],
    'price' => '6',
  ))->subscription;
  $collection = Braintree_Subscription::search(array(
    Braintree_SubscriptionSearch::planId()
      ->isNot("integration_trialless_plan"),
    Braintree_SubscriptionSearch::price()
      ->is("6"),
  ));
  $this
    ->assertTrue(Braintree_TestHelper::includes($collection, $trialSubscription));
  $this
    ->assertFalse(Braintree_TestHelper::includes($collection, $triallessSubscription));
}