Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
Updates customer tests to match new preparable setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 26, 2016
1 parent 85ba6e9 commit 6fa73e5
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions tests/CustomerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ public function it_can_instantiate_via_the_constructor()
$customer = new Customer();

$this->assertEquals(Customer::class, get_class($customer));
$this->assertObjectHasAttribute('id', $customer);
$this->assertObjectHasAttribute('email', $customer);
$this->assertObjectHasAttribute('phone', $customer);
$this->assertObjectHasAttribute('note', $customer);
$this->assertObjectHasAttribute('data', $customer);
}

/** @test */
Expand All @@ -22,9 +19,23 @@ public function it_can_instantiate_via_a_static_create_method()
$customer = Customer::create();

$this->assertEquals(Customer::class, get_class($customer));
$this->assertObjectHasAttribute('id', $customer);
$this->assertObjectHasAttribute('email', $customer);
$this->assertObjectHasAttribute('phone', $customer);
$this->assertObjectHasAttribute('note', $customer);
$this->assertObjectHasAttribute('data', $customer);
}

/** @test */
public function it_can_access_customer_data_that_exists_on_the_class()
{
$params = [
'id' => uniqid('customer-', true),
'email' => '[email protected]',
'phone' => '555-555-5555',
'note' => 'Customer note',
];
$customer = Customer::create($params);

$this->assertEquals($params['id'], $customer->id);
$this->assertEquals($params['email'], $customer->email);
$this->assertEquals($params['phone'], $customer->phone);
$this->assertEquals($params['note'], $customer->note);
}
}

0 comments on commit 6fa73e5

Please sign in to comment.