6
6
*/
7
7
namespace Magento \Quote \Api ;
8
8
9
- use Magento \Catalog \Model \Indexer \Product \Category \Processor ;
10
9
use Magento \Catalog \Test \Fixture \Product as ProductFixture ;
11
10
use Magento \Checkout \Test \Fixture \SetBillingAddress as SetBillingAddressFixture ;
12
11
use Magento \Checkout \Test \Fixture \SetDeliveryMethod as SetDeliveryMethodFixture ;
27
26
use Magento \TestFramework \TestCase \WebapiAbstract ;
28
27
use Magento \Quote \Model \Quote ;
29
28
use Magento \Quote \Model \Quote \Address ;
29
+ use Magento \TestModuleOverrideConfig \Inheritance \Fixtures \FixturesInterface ;
30
30
31
31
class CartTotalRepositoryTest extends WebapiAbstract
32
32
{
@@ -35,11 +35,6 @@ class CartTotalRepositoryTest extends WebapiAbstract
35
35
*/
36
36
private $ objectManager ;
37
37
38
- /**
39
- * @var Processor
40
- */
41
- private $ indexer ;
42
-
43
38
/**
44
39
* @var SearchCriteriaBuilder
45
40
*/
@@ -50,6 +45,11 @@ class CartTotalRepositoryTest extends WebapiAbstract
50
45
*/
51
46
private $ filterBuilder ;
52
47
48
+ /**
49
+ * @var FixturesInterface
50
+ */
51
+ private $ fixtures ;
52
+
53
53
protected function setUp (): void
54
54
{
55
55
$ this ->objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
@@ -99,15 +99,64 @@ public function testGetTotals()
99
99
* @magentoConfigFixture default_store shipping/origin/postcode 10011
100
100
*/
101
101
#[
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
+ ),
111
160
]
112
161
public function testGetGrandTotalsWithIncludedTaxAndSameCurrency ()
113
162
{
0 commit comments