This repository has been archived by the owner on Oct 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates customer tests to match new preparable setting
- Loading branch information
Craig Paul
committed
Oct 26, 2016
1 parent
85ba6e9
commit 6fa73e5
Showing
1 changed file
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 */ | ||
|
@@ -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); | ||
} | ||
} |