You are here

function Braintree_CustomerTest::testFind in Commerce Braintree 7

File

braintree_php/tests/integration/CustomerTest.php, line 345

Class

Braintree_CustomerTest

Code

function testFind() {
  $result = Braintree_Customer::create(array(
    'firstName' => 'Mike',
    'lastName' => 'Jones',
    'company' => 'Jones Co.',
    'email' => 'mike.jones@example.com',
    'phone' => '419.555.1234',
    'fax' => '419.555.1235',
    'website' => 'http://example.com',
  ));
  $this
    ->assertEquals(true, $result->success);
  $customer = Braintree_Customer::find($result->customer->id);
  $this
    ->assertEquals('Mike', $customer->firstName);
  $this
    ->assertEquals('Jones', $customer->lastName);
  $this
    ->assertEquals('Jones Co.', $customer->company);
  $this
    ->assertEquals('mike.jones@example.com', $customer->email);
  $this
    ->assertEquals('419.555.1234', $customer->phone);
  $this
    ->assertEquals('419.555.1235', $customer->fax);
  $this
    ->assertEquals('http://example.com', $customer->website);
}