public function testSearch_statusIsExpired() { $found = false; $collection = Braintree\Subscription::search([Braintree\SubscriptionSearch::status()->in([Braintree\Subscription::EXPIRED])]); foreach ($collection as $item) { $found = true; $this->assertEquals(Braintree\Subscription::EXPIRED, $item->status); } $this->assertTrue($found); }
public function testIn_multipleValues() { $creditCard = SubscriptionHelper::createCreditCard(); $triallessPlan = SubscriptionHelper::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(Test\Helper::includes($collection, $activeSubscription)); $this->assertTrue(Test\Helper::includes($collection, $canceledSubscription)); }
public function testSearch_status_isMultipleValueNode() { $node = Braintree\SubscriptionSearch::status(); $this->assertInstanceOf('Braintree\\MultipleValueNode', $node); }