function Braintree_TransactionAdvancedSearchTest::test_multipleValueNode_creditCardCustomerLocation in Commerce Braintree 7
File
- braintree_php/
tests/ integration/ TransactionAdvancedSearchTest.php, line 320
Class
Code
function test_multipleValueNode_creditCardCustomerLocation() {
$transaction = Braintree_Transaction::saleNoValidate(array(
'amount' => Braintree_Test_TransactionAmounts::$authorize,
'creditCard' => array(
'number' => Braintree_Test_CreditCardNumbers::$visa,
'expirationDate' => '05/2012',
),
));
$collection = Braintree_Transaction::search(array(
Braintree_TransactionSearch::id()
->is($transaction->id),
Braintree_TransactionSearch::creditCardCustomerLocation()
->is(Braintree_CreditCard::US),
));
$this
->assertEquals(1, $collection
->maximumCount());
$this
->assertEquals($transaction->id, $collection
->firstItem()->id);
$collection = Braintree_Transaction::search(array(
Braintree_TransactionSearch::id()
->is($transaction->id),
Braintree_TransactionSearch::creditCardCustomerLocation()
->in(array(
Braintree_CreditCard::US,
Braintree_CreditCard::INTERNATIONAL,
)),
));
$this
->assertEquals(1, $collection
->maximumCount());
$this
->assertEquals($transaction->id, $collection
->firstItem()->id);
$collection = Braintree_Transaction::search(array(
Braintree_TransactionSearch::id()
->is($transaction->id),
Braintree_TransactionSearch::creditCardCustomerLocation()
->in(array(
Braintree_CreditCard::INTERNATIONAL,
)),
));
$this
->assertEquals(0, $collection
->maximumCount());
}