-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* set to php 7.2 in sdk docker image to get tests running * Add unit tests for RiskData * drop RiskDataScore integration check * fixup unit tests
- Loading branch information
hstotelmyer
authored and
GitHub Enterprise
committed
Mar 1, 2021
1 parent
65b5fbe
commit 481daa3
Showing
4 changed files
with
39 additions
and
3 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
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,38 @@ | ||
<?php | ||
namespace Test\Unit; | ||
|
||
require_once dirname(__DIR__) . '/Setup.php'; | ||
|
||
use DateTime; | ||
use Test\Setup; | ||
use Braintree; | ||
|
||
class RiskDataTest extends Setup | ||
{ | ||
|
||
public function testAttributes() | ||
{ | ||
$riskData = Braintree\RiskData::factory([ | ||
'customerDeviceId' => 'deviceId', | ||
'customerLocationZip' => '12345', | ||
'customerTenure' => 'tenure', | ||
'decision' => 'decision', | ||
'id' => 'id', | ||
'transactionRiskScore' => '100', | ||
'deviceDataCaptured' => true, | ||
'decisionReasons' => [ | ||
'foo', 'bar' | ||
], | ||
]); | ||
|
||
$this->assertEquals('deviceId', $riskData->customerDeviceId); | ||
$this->assertEquals('12345', $riskData->customerLocationZip); | ||
$this->assertEquals('tenure', $riskData->customerTenure); | ||
$this->assertEquals('decision', $riskData->decision); | ||
$this->assertEquals('id', $riskData->id); | ||
$this->assertEquals('100', $riskData->transactionRiskScore); | ||
$this->assertTrue($riskData->deviceDataCaptured); | ||
$this->assertContains('foo', $riskData->decisionReasons); | ||
$this->assertContains('bar', $riskData->decisionReasons); | ||
} | ||
} |