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