ConfigTest.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Tax\Model;
  7. class ConfigTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Magento\Tax\Model\Config
  11. */
  12. protected $_model = null;
  13. protected function setUp()
  14. {
  15. $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
  16. \Magento\Tax\Model\Config::class
  17. );
  18. }
  19. public function testSetPriceIncludesTax()
  20. {
  21. $this->assertFalse($this->_model->priceIncludesTax());
  22. $this->assertSame($this->_model, $this->_model->setPriceIncludesTax(1));
  23. $this->assertTrue($this->_model->priceIncludesTax());
  24. $this->_model->setPriceIncludesTax(null);
  25. $this->assertFalse($this->_model->priceIncludesTax());
  26. }
  27. /**
  28. * @magentoConfigFixture current_store tax/calculation/price_includes_tax 1
  29. */
  30. public function testPriceIncludesTaxNonDefault()
  31. {
  32. $this->assertTrue($this->_model->priceIncludesTax());
  33. }
  34. }