-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop'
- Loading branch information
Showing
7 changed files
with
53 additions
and
119 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 was deleted.
Oops, something went wrong.
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
37 changes: 37 additions & 0 deletions
37
test/UnitTest/HostedService/HandleOrder/QueryTransactionResponseTest.php
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,37 @@ | ||
<?php | ||
|
||
|
||
namespace Svea\WebPay\Test\UnitTest\HostedService\HandleOrder; | ||
|
||
|
||
use Svea\WebPay\HostedService\HostedResponse\HostedAdminResponse\QueryTransactionResponse; | ||
|
||
class QueryTransactionResponseTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
function test_calculateVatPercentFromVatAndAmount_returns_correct_vatpercent_if_transactions_contains_negative_row() | ||
{ | ||
$queryTransactionResponse = new QueryTransactionResponse("", "", ""); | ||
|
||
$test = $queryTransactionResponse->calculateVatPercentFromVatAndAmount("-1252", "-6262"); | ||
|
||
$this->assertEquals("25.00", $test); | ||
} | ||
|
||
function test_calculateVatPercentFromVatAndAmount_returns_correct_vatpercent_if_transactions_contains_positive_row() | ||
{ | ||
$queryTransactionResponse = new QueryTransactionResponse("", "", ""); | ||
|
||
$test = $queryTransactionResponse->calculateVatPercentFromVatAndAmount("1252", "6262"); | ||
|
||
$this->assertEquals("25.00", $test); | ||
} | ||
|
||
function test_calculateVatPercentFromVatAndAmount_returns_correct_vatpercent_if_transactions_contains_zero_amount_row() | ||
{ | ||
$queryTransactionResponse = new QueryTransactionResponse("", "", ""); | ||
|
||
$test = $queryTransactionResponse->calculateVatPercentFromVatAndAmount("0", "0"); | ||
|
||
$this->assertEquals("0.00", $test); | ||
} | ||
} |
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,3 @@ | ||
{ | ||
"version": "3.11.1" | ||
} |