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.
Adds instantiation tests for CreditCard
- Loading branch information
Craig Paul
committed
Oct 21, 2016
1 parent
9b45366
commit 8b6fedd
Showing
2 changed files
with
28 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
use CraigPaul\Moneris\Crypt; | ||
use CraigPaul\Moneris\CreditCard; | ||
|
||
class CreditCardTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_can_instantiate_via_the_constructor() | ||
{ | ||
$card = new CreditCard($this->visa, '2012', Crypt::SSL_ENABLED_MERCHANT); | ||
|
||
$this->assertEquals(CreditCard::class, get_class($card)); | ||
$this->assertObjectHasAttribute('number', $card); | ||
$this->assertObjectHasAttribute('expiry', $card); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_instantiate_via_a_static_create_method() | ||
{ | ||
$card = CreditCard::create($this->visa, '2012', Crypt::SSL_ENABLED_MERCHANT); | ||
|
||
$this->assertEquals(CreditCard::class, get_class($card)); | ||
$this->assertObjectHasAttribute('number', $card); | ||
$this->assertObjectHasAttribute('expiry', $card); | ||
} | ||
} |