function Braintree_TextNodeTest::testIs in Commerce Braintree 7
Same name in this branch
- 7 braintree_php/tests/unit/TextNodeTest.php \Braintree_TextNodeTest::testIs()
- 7 braintree_php/tests/integration/TextNodeTest.php \Braintree_TextNodeTest::testIs()
File
- braintree_php/
tests/ integration/ TextNodeTest.php, line 7
Class
Code
function testIs() {
$creditCard = Braintree_SubscriptionTestHelper::createCreditCard();
$triallessPlan = Braintree_SubscriptionTestHelper::triallessPlan();
$trialPlan = Braintree_SubscriptionTestHelper::trialPlan();
$trialSubscription = Braintree_Subscription::create(array(
'paymentMethodToken' => $creditCard->token,
'planId' => $trialPlan['id'],
'price' => '5',
))->subscription;
$triallessSubscription = Braintree_Subscription::create(array(
'paymentMethodToken' => $creditCard->token,
'planId' => $triallessPlan['id'],
'price' => '5',
))->subscription;
$collection = Braintree_Subscription::search(array(
Braintree_SubscriptionSearch::planId()
->is("integration_trial_plan"),
Braintree_SubscriptionSearch::price()
->is('5'),
));
$this
->assertTrue(Braintree_TestHelper::includes($collection, $trialSubscription));
$this
->assertFalse(Braintree_TestHelper::includes($collection, $triallessSubscription));
}