function Braintree_CreditCardTest::testCreate_withExpirationMonthAndYear in Commerce Braintree 7
File
- braintree_php/
tests/ integration/ CreditCardTest.php, line 50
Class
Code
function testCreate_withExpirationMonthAndYear() {
$customer = Braintree_Customer::createNoValidate();
$result = Braintree_CreditCard::create(array(
'customerId' => $customer->id,
'cardholderName' => 'Cardholder',
'number' => '5105105105105100',
'expirationMonth' => '05',
'expirationYear' => '2011',
));
$this
->assertTrue($result->success);
$this
->assertEquals($customer->id, $result->creditCard->customerId);
$this
->assertEquals('510510', $result->creditCard->bin);
$this
->assertEquals('5100', $result->creditCard->last4);
$this
->assertEquals('Cardholder', $result->creditCard->cardholderName);
$this
->assertEquals('05/2011', $result->creditCard->expirationDate);
}