Skip to content

Commit 2f1d05e

Browse files
committed
ACP2E-1634: added integration test
1 parent a670c85 commit 2f1d05e

File tree

1 file changed

+64
-9
lines changed

1 file changed

+64
-9
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,29 @@
66

77
namespace Magento\Catalog\Pricing\Render;
88

9-
use Magento\TestFramework\Helper\Bootstrap;
10-
use Magento\Framework\ObjectManagerInterface;
11-
use Magento\Catalog\Pricing\Price\FinalPrice;
12-
use Magento\Framework\Pricing\Render\RendererPool;
9+
use Magento\Catalog\Api\Data\ProductInterface;
1310
use Magento\Catalog\Api\ProductRepositoryInterface;
14-
use Magento\Framework\Pricing\Render\Amount;
15-
use Magento\Framework\App\State;
11+
use Magento\Catalog\Pricing\Price\FinalPrice;
12+
use Magento\Catalog\Test\Fixture\Category as CategoryFixture;
13+
use Magento\Catalog\Test\Fixture\Product as ProductFixture;
14+
use Magento\Customer\Model\Group;
1615
use Magento\Framework\App\Area;
16+
use Magento\Framework\App\State;
17+
use Magento\Framework\ObjectManagerInterface;
18+
use Magento\Framework\Pricing\Render\Amount;
19+
use Magento\Framework\Pricing\Render\RendererPool;
1720
use Magento\Framework\View\TemplateEngine\Php;
1821
use Magento\Framework\View\TemplateEnginePool;
19-
use Magento\Catalog\Api\Data\ProductInterface;
22+
use Magento\Tax\Model\Config as TaxConfig;
23+
use Magento\Tax\Test\Fixture\CustomerTaxClass as CustomerTaxClassFixture;
24+
use Magento\Tax\Test\Fixture\ProductTaxClass as ProductTaxClassFixture;
25+
use Magento\Tax\Test\Fixture\TaxRate as TaxRateFixture;
26+
use Magento\Tax\Test\Fixture\TaxRule as TaxRuleFixture;
27+
use Magento\TestFramework\Fixture\AppIsolation;
28+
use Magento\TestFramework\Fixture\Config;
29+
use Magento\TestFramework\Fixture\DataFixture;
30+
use Magento\TestFramework\Fixture\DbIsolation;
31+
use Magento\TestFramework\Helper\Bootstrap;
2032

2133
/**
2234
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -97,8 +109,7 @@ protected function setUp(): void
97109

98110
$this->rendererPool->setData(
99111
[
100-
'default' =>
101-
[
112+
'default' => [
102113
'default_amount_render_class' => Amount::class,
103114
'default_amount_render_template' => 'Magento_Catalog::product/price/amount/default.phtml'
104115
]
@@ -147,4 +158,48 @@ public function testProductSetDifferentStorePricesWithoutTierPriceShouldNotShowA
147158
{
148159
$this->assertEmpty($this->finalPriceBox->renderAmountMinimal());
149160
}
161+
162+
#[
163+
AppIsolation(true),
164+
DbIsolation(false),
165+
Config(TaxConfig::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, 0),
166+
Config(TaxConfig::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, 3),
167+
DataFixture(CategoryFixture::class, as: 'category'),
168+
DataFixture(
169+
ProductFixture::class,
170+
[
171+
'sku' => 'tier_prices',
172+
'category_ids' => ['1', '$category.id$'],
173+
'tier_prices' => [
174+
[
175+
'customer_group_id' => Group::NOT_LOGGED_IN_ID,
176+
'qty' => 2,
177+
'value' => 5
178+
]
179+
]
180+
]
181+
),
182+
DataFixture(CustomerTaxClassFixture::class, as: 'customerTax'),
183+
DataFixture(ProductTaxClassFixture::class, as: 'productTax'),
184+
DataFixture(
185+
TaxRateFixture::class,
186+
[],
187+
'rate'
188+
),
189+
DataFixture(
190+
TaxRuleFixture::class,
191+
[
192+
'customer_tax_class_ids' => ['$customerTax.id$'],
193+
'product_tax_class_ids' => ['$productTax.id$'],
194+
'tax_rate_ids' => ['$rate.id$']
195+
],
196+
'rule'
197+
)
198+
199+
]
200+
public function testRenderAmountMinimalProductWithTierPricesShouldShowMinTierPriceWithTaxes()
201+
{
202+
$result = $this->finalPriceBox->renderAmountMinimal();
203+
$this->assertStringContainsString('$5.00', $result);
204+
}
150205
}

0 commit comments

Comments
 (0)