function Braintree_TransactionTest::testSale_withInvalidPurchaseOrderNumber in Commerce Braintree 7
File
- braintree_php/
tests/ integration/ TransactionTest.php, line 175
Class
Code
function testSale_withInvalidPurchaseOrderNumber() {
$result = Braintree_Transaction::sale(array(
'amount' => '100.00',
'creditCard' => array(
'cardholderName' => 'The Cardholder',
'expirationDate' => '05/2011',
'number' => '5105105105105100',
),
'purchaseOrderNumber' => "",
));
$this
->assertFalse($result->success);
$purchaseOrderNumberErrors = $result->errors
->forKey('transaction')
->onAttribute('purchaseOrderNumber');
$this
->assertEquals(Braintree_Error_Codes::TRANSACTION_PURCHASE_ORDER_NUMBER_IS_INVALID, $purchaseOrderNumberErrors[0]->code);
}