/** * @return MultipleValueNode */ public function merchantAccountId() { return TransactionSearch::merchantAccountId(); }
public function test_multipleValueNode_merchantAccountId() { $transaction = Braintree\Transaction::saleNoValidate(['amount' => Braintree\Test\TransactionAmounts::$authorize, 'creditCard' => ['number' => Braintree\Test\CreditCardNumbers::$visa, 'expirationDate' => '05/2012']]); $collection = Braintree\Transaction::search([Braintree\TransactionSearch::id()->is($transaction->id), Braintree\TransactionSearch::merchantAccountId()->is($transaction->merchantAccountId)]); $this->assertEquals(1, $collection->maximumCount()); $this->assertEquals($transaction->id, $collection->firstItem()->id); $collection = Braintree\Transaction::search([Braintree\TransactionSearch::id()->is($transaction->id), Braintree\TransactionSearch::merchantAccountId()->in([$transaction->merchantAccountId, "bogus_merchant_account_id"])]); $this->assertEquals(1, $collection->maximumCount()); $this->assertEquals($transaction->id, $collection->firstItem()->id); $collection = Braintree\Transaction::search([Braintree\TransactionSearch::id()->is($transaction->id), Braintree\TransactionSearch::merchantAccountId()->is('bogus_merchant_account_id')]); $this->assertEquals(0, $collection->maximumCount()); }