-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
113 additions
and
42 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This file is for unifying the coding style for different editors and IDEs | ||
# editorconfig.org | ||
|
||
# PHP PSR-2 Coding Standards | ||
# http://www.php-fig.org/psr/psr-2/ | ||
|
||
root = true | ||
|
||
[*.php] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = space | ||
indent_size = 4 |
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
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
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
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,34 @@ | ||
<?php | ||
|
||
namespace CommerceGuys\AuthNet\Tests; | ||
|
||
use CommerceGuys\AuthNet\DataTypes\CreditCard; | ||
use CommerceGuys\AuthNet\DataTypes\Message; | ||
|
||
class DataTypeTest extends TestBase | ||
{ | ||
public function testBaseDataType() | ||
{ | ||
// Tests methods provided by \CommerceGuys\AuthNet\DataTypes\BaseDataType | ||
$creditCard = new CreditCard([ | ||
'cardNumber' => '4111111111111111', | ||
'expirationDate' => '2020-12', | ||
]); | ||
unset($creditCard->cardNumber); | ||
$this->assertTrue(!isset($creditCard->cardNumber)); | ||
$creditCard->addData('cardNumber', '5424000000000015'); | ||
$this->assertEquals('5424000000000015', $creditCard->cardNumber); | ||
} | ||
|
||
public function testMessageValidationCode() | ||
{ | ||
$this->setExpectedException(\InvalidArgumentException::class, 'Messages must have a code'); | ||
new Message(['message' => 'Test']); | ||
} | ||
|
||
public function testMessageValidationTest() | ||
{ | ||
$this->setExpectedException(\InvalidArgumentException::class, 'Messages must have a text'); | ||
new Message(['code' => 'I00122']); | ||
} | ||
} |
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