silvercommerce /
tax-admin
| 1 | <?php |
||
| 2 | |||
| 3 | namespace SilverCommerce\TaxAdmin\Tests; |
||
| 4 | |||
| 5 | use SilverStripe\Dev\SapphireTest; |
||
| 6 | use SilverStripe\Core\Config\Config; |
||
| 7 | use SilverCommerce\GeoZones\Model\Region; |
||
| 8 | use SilverCommerce\TaxAdmin\Model\TaxRate; |
||
| 9 | use SilverCommerce\TaxAdmin\Tests\Model\TestProduct; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Test functionality of postage extension |
||
| 13 | * |
||
| 14 | */ |
||
| 15 | class TaxRateTest extends SapphireTest |
||
| 16 | { |
||
| 17 | |||
| 18 | protected static $fixture_file = 'TaxData.yml'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Setup test only objects |
||
| 22 | * |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | protected static $extra_dataobjects = [ |
||
| 26 | TestProduct::class |
||
| 27 | ]; |
||
| 28 | |||
| 29 | public function setUp() |
||
| 30 | { |
||
| 31 | parent::setUp(); |
||
| 32 | Config::inst()->set(Region::class, "create_on_build", false); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Test that Tax Rate returns an accurate list |
||
| 37 | */ |
||
| 38 | public function testZonesList() |
||
| 39 | { |
||
| 40 | $obj = $this->objFromFixture(TaxRate::class, "vat"); |
||
| 41 | |||
| 42 | // Test default location |
||
| 43 | $this->assertTrue(strpos($obj->ZonesList, "UK") !== false); |
||
| 44 | $this->assertTrue(strpos($obj->ZonesList, "Germany") !== false); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |