You are here

function Braintree_Result_ErrorTest::testValueForHtmlField in Commerce Braintree 7

File

braintree_php/tests/integration/Result/ErrorTest.php, line 6

Class

Braintree_Result_ErrorTest

Code

function testValueForHtmlField() {
  $result = Braintree_Customer::create(array(
    'email' => 'invalid-email',
    'creditCard' => array(
      'number' => 'invalid-number',
      'expirationDate' => 'invalid-exp',
      'billingAddress' => array(
        'countryName' => 'invalid-country',
      ),
    ),
  ));
  $this
    ->assertEquals(false, $result->success);
  $this
    ->assertEquals('invalid-email', $result
    ->valueForHtmlField('customer[email]'));
  $this
    ->assertEquals('', $result
    ->valueForHtmlField('customer[credit_card][number]'));
  $this
    ->assertEquals('invalid-exp', $result
    ->valueForHtmlField('customer[credit_card][expiration_date]'));
  $this
    ->assertEquals('invalid-country', $result
    ->valueForHtmlField('customer[credit_card][billing_address][country_name]'));
}