Skip to content

Commit 205c0b3

Browse files
committed
ACP2E-964: grand_total and base_grand_total have different values, although we have only ONE currency
- updated after statis tests fails
1 parent ff39d2a commit 205c0b3

File tree

1 file changed

+64
-15
lines changed

1 file changed

+64
-15
lines changed

dev/tests/api-functional/testsuite/Magento/Quote/Api/CartTotalRepositoryTest.php

Lines changed: 64 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
namespace Magento\Quote\Api;
88

9-
use Magento\Catalog\Model\Indexer\Product\Category\Processor;
109
use Magento\Catalog\Test\Fixture\Product as ProductFixture;
1110
use Magento\Checkout\Test\Fixture\SetBillingAddress as SetBillingAddressFixture;
1211
use Magento\Checkout\Test\Fixture\SetDeliveryMethod as SetDeliveryMethodFixture;
@@ -27,6 +26,7 @@
2726
use Magento\TestFramework\TestCase\WebapiAbstract;
2827
use Magento\Quote\Model\Quote;
2928
use Magento\Quote\Model\Quote\Address;
29+
use Magento\TestModuleOverrideConfig\Inheritance\Fixtures\FixturesInterface;
3030

3131
class CartTotalRepositoryTest extends WebapiAbstract
3232
{
@@ -35,11 +35,6 @@ class CartTotalRepositoryTest extends WebapiAbstract
3535
*/
3636
private $objectManager;
3737

38-
/**
39-
* @var Processor
40-
*/
41-
private $indexer;
42-
4338
/**
4439
* @var SearchCriteriaBuilder
4540
*/
@@ -50,6 +45,11 @@ class CartTotalRepositoryTest extends WebapiAbstract
5045
*/
5146
private $filterBuilder;
5247

48+
/**
49+
* @var FixturesInterface
50+
*/
51+
private $fixtures;
52+
5353
protected function setUp(): void
5454
{
5555
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -99,15 +99,64 @@ public function testGetTotals()
9999
* @magentoConfigFixture default_store shipping/origin/postcode 10011
100100
*/
101101
#[
102-
DataFixture(TaxRule::class, ['tax_rate_ids' => [2], 'product_tax_class_ids' => [2], 'customer_tax_class_ids' => [3], 'code' => 'TaxRule1'], 'tax_rule'),
103-
DataFixture(ProductFixture::class, ['price'=>5], 'product'),
104-
DataFixture(GuestCartFixture::class, as: 'cart'),
105-
DataFixture(AddProductToCartFixture::class, ['cart_id' => '$cart.id$', 'product_id' => '$product.id$']),
106-
DataFixture(SetBillingAddressFixture::class, ['cart_id' => '$cart.id$', 'address' => [AddressInterface::KEY_POSTCODE => 10036, AddressInterface::KEY_CITY => 'New York', AddressInterface::KEY_REGION_ID => 43] ]),
107-
DataFixture(SetShippingAddressFixture::class, ['cart_id' => '$cart.id$', 'address' => [AddressInterface::KEY_POSTCODE => 10036, AddressInterface::KEY_CITY => 'New York', AddressInterface::KEY_REGION_ID => 43] ]),
108-
DataFixture(SetGuestEmailFixture::class, ['cart_id' => '$cart.id$']),
109-
DataFixture(SetDeliveryMethodFixture::class, ['cart_id' => '$cart.id$']),
110-
DataFixture(SetPaymentMethodFixture::class, ['cart_id' => '$cart.id$']),
102+
DataFixture(
103+
TaxRule::class, [
104+
'tax_rate_ids' => [2],
105+
'product_tax_class_ids' => [2],
106+
'customer_tax_class_ids' => [3]
107+
],
108+
'tax_rule'
109+
),
110+
DataFixture(
111+
ProductFixture::class, [
112+
'price'=>5
113+
],
114+
'product'
115+
),
116+
DataFixture(
117+
GuestCartFixture::class, as: 'cart'
118+
),
119+
DataFixture(
120+
AddProductToCartFixture::class, [
121+
'cart_id' => '$cart.id$',
122+
'product_id' => '$product.id$'
123+
]
124+
),
125+
DataFixture(
126+
SetBillingAddressFixture::class, [
127+
'cart_id' => '$cart.id$',
128+
'address' => [
129+
AddressInterface::KEY_POSTCODE => 10036,
130+
AddressInterface::KEY_CITY => 'New York',
131+
AddressInterface::KEY_REGION_ID => 43
132+
]
133+
]
134+
),
135+
DataFixture(
136+
SetShippingAddressFixture::class, [
137+
'cart_id' => '$cart.id$',
138+
'address' => [
139+
AddressInterface::KEY_POSTCODE => 10036,
140+
AddressInterface::KEY_CITY => 'New York',
141+
AddressInterface::KEY_REGION_ID => 43
142+
]
143+
]
144+
),
145+
DataFixture(
146+
SetGuestEmailFixture::class, [
147+
'cart_id' => '$cart.id$'
148+
]
149+
),
150+
DataFixture(
151+
SetDeliveryMethodFixture::class, [
152+
'cart_id' => '$cart.id$'
153+
]
154+
),
155+
DataFixture(
156+
SetPaymentMethodFixture::class, [
157+
'cart_id' => '$cart.id$'
158+
]
159+
),
111160
]
112161
public function testGetGrandTotalsWithIncludedTaxAndSameCurrency()
113162
{

0 commit comments

Comments
 (0)