public function testSearch_daysPastDue() { $creditCard = SubscriptionHelper::createCreditCard(); $triallessPlan = SubscriptionHelper::triallessPlan(); $subscription = Braintree\Subscription::create(['paymentMethodToken' => $creditCard->token, 'planId' => $triallessPlan['id']])->subscription; $http = new Braintree\Http(Braintree\Configuration::$global); $path = Braintree\Configuration::$global->merchantPath() . '/subscriptions/' . $subscription->id . '/make_past_due'; $http->put($path, ['daysPastDue' => 5]); $found = false; $collection = Braintree\Subscription::search([Braintree\SubscriptionSearch::daysPastDue()->between(2, 10)]); foreach ($collection as $item) { $found = true; $this->assertTrue($item->daysPastDue <= 10); $this->assertTrue($item->daysPastDue >= 2); } $this->assertTrue($found); }
public function testSearch_daysPastDue_isRangeNode() { $node = Braintree\SubscriptionSearch::daysPastDue(); $this->assertInstanceOf('Braintree\\RangeNode', $node); }