You are here

class Braintree_Result_ErrorTest in Commerce Braintree 7

Same name in this branch
  1. 7 braintree_php/tests/unit/Result/ErrorTest.php \Braintree_Result_ErrorTest
  2. 7 braintree_php/tests/integration/Result/ErrorTest.php \Braintree_Result_ErrorTest

Hierarchy

Expanded class hierarchy of Braintree_Result_ErrorTest

File

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

View source
class Braintree_Result_ErrorTest extends PHPUnit_Framework_TestCase {
  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]'));
  }

}

Members