You are here

class Braintree_CustomerTest in Commerce Braintree 7

Same name in this branch
  1. 7 braintree_php/tests/unit/CustomerTest.php \Braintree_CustomerTest
  2. 7 braintree_php/tests/integration/CustomerTest.php \Braintree_CustomerTest

Hierarchy

Expanded class hierarchy of Braintree_CustomerTest

File

braintree_php/tests/unit/CustomerTest.php, line 4

View source
class Braintree_CustomerTest extends PHPUnit_Framework_TestCase {
  function testGet_givesErrorIfInvalidProperty() {
    $this
      ->setExpectedException('PHPUnit_Framework_Error', 'Undefined property on Braintree_Customer: foo');
    $c = Braintree_Customer::factory(array());
    $c->foo;
  }
  function testUpdateSignature_doesNotAlterOptionsInCreditCardUpdateSignature() {
    Braintree_Customer::updateSignature();
    foreach (Braintree_CreditCard::updateSignature() as $key => $value) {
      if (is_array($value) and array_key_exists('options', $value)) {
        $this
          ->assertEquals(array(
          'makeDefault',
          'verificationMerchantAccountId',
          'verifyCard',
        ), $value['options']);
      }
    }
  }
  function testFindErrorsOnBlankId() {
    $this
      ->setExpectedException('InvalidArgumentException');
    Braintree_Customer::find('');
  }
  function testFindErrorsOnWhitespaceId() {
    $this
      ->setExpectedException('InvalidArgumentException');
    Braintree_Customer::find('\\t');
  }

}

Members