This repository has been archived by the owner on Oct 27, 2024. It is now read-only.
forked from driesvints/vat-calculator
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Norway rate but add an option to add it back again
See these as why NO was removed: driesvints#43 driesvints#14 (comment)
- Loading branch information
Showing
4 changed files
with
72 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
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,42 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace Spaze\VatCalculator; | ||
|
||
use PHPUnit_Framework_TestCase; | ||
|
||
class VatRatesTest extends PHPUnit_Framework_TestCase | ||
{ | ||
|
||
/** @var VatRates */ | ||
private $vatRates; | ||
|
||
|
||
protected function setUp() | ||
{ | ||
$this->vatRates = new VatRates(); | ||
} | ||
|
||
|
||
public function testAddRateKnownCountry(): void | ||
{ | ||
$country = 'nO'; | ||
$this->assertFalse($this->vatRates->shouldCollectVat($country)); | ||
$this->assertEquals(0, $this->vatRates->getTaxRateForLocation($country)); | ||
$this->vatRates->addRateForCountry($country); | ||
$this->assertTrue($this->vatRates->shouldCollectVat($country)); | ||
$this->assertEquals(0.25, $this->vatRates->getTaxRateForLocation($country)); | ||
} | ||
|
||
|
||
public function testAddRateUnknownCountry(): void | ||
{ | ||
$country = 'yEs'; | ||
$this->assertFalse($this->vatRates->shouldCollectVat($country)); | ||
$this->assertEquals(0, $this->vatRates->getTaxRateForLocation($country)); | ||
$this->vatRates->addRateForCountry($country); | ||
$this->assertFalse($this->vatRates->shouldCollectVat($country)); | ||
$this->assertEquals(0, $this->vatRates->getTaxRateForLocation($country)); | ||
} | ||
|
||
} |