@@ -28,13 +28,40 @@ class GetCustomerCartTest extends GraphQlAbstract
28
28
*/
29
29
private $ customerTokenService ;
30
30
31
+ /**
32
+ * @var \Magento\Framework\ObjectManagerInterface
33
+ */
34
+ protected $ objectManager ;
35
+
31
36
protected function setUp ()
32
37
{
33
38
$ objectManager = Bootstrap::getObjectManager ();
34
39
$ this ->getMaskedQuoteIdByReservedOrderId = $ objectManager ->get (GetMaskedQuoteIdByReservedOrderId::class);
35
40
$ this ->customerTokenService = $ objectManager ->get (CustomerTokenServiceInterface::class);
36
41
}
37
42
43
+ /**
44
+ * @inheritdoc
45
+ */
46
+ protected function tearDown ()
47
+ {
48
+ /** @var \Magento\Framework\Registry $registry */
49
+ $ registry = Bootstrap::getObjectManager ()->get (\Magento \Framework \Registry::class);
50
+ $ registry ->unregister ('isSecureArea ' );
51
+ $ registry ->register ('isSecureArea ' , true );
52
+
53
+ /** @var $order \Magento\Quote\Model\Quote */
54
+ $ quoteCollection = Bootstrap::getObjectManager ()->create (\Magento \Quote \Model \ResourceModel \Quote \Collection::class);
55
+ foreach ($ quoteCollection as $ quote ) {
56
+ $ quote ->delete ();
57
+ }
58
+
59
+ $ registry ->unregister ('isSecureArea ' );
60
+ $ registry ->register ('isSecureArea ' , false );
61
+
62
+ parent ::tearDown ();
63
+ }
64
+
38
65
/**
39
66
* Query for an existing active customer cart
40
67
*
@@ -87,7 +114,6 @@ public function testGetLoggedInCustomerCartWithoutMaskedQuoteId()
87
114
* Query for customer cart for a user with no existing active cart
88
115
*
89
116
* @magentoApiDataFixture Magento/Customer/_files/customer.php
90
- * @magentoApiDataFixture Magento/Checkout/_files/rollback_quote.php
91
117
*/
92
118
public function testGetNewCustomerCart ()
93
119
{
@@ -138,7 +164,6 @@ public function testGetCustomerCartAfterTokenRevoked()
138
164
* Querying for the customer cart twice->should return the same cart
139
165
*
140
166
* @magentoApiDataFixture Magento/Customer/_files/customer.php
141
- * @magentoApiDataFixture Magento/Checkout/_files/rollback_quote.php
142
167
*/
143
168
public function testRequestCustomerCartTwice ()
144
169
{
@@ -161,7 +186,6 @@ public function testRequestCustomerCartTwice()
161
186
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
162
187
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
163
188
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/make_cart_inactive.php
164
- * @magentoApiDataFixture Magento/Checkout/_files/rollback_quote.php
165
189
*/
166
190
public function testGetInactiveCustomerCart ()
167
191
{
@@ -176,7 +200,6 @@ public function testGetInactiveCustomerCart()
176
200
/**
177
201
* Querying for an existing customer cart for second store
178
202
*
179
- * @magentoApiDataFixture Magento/Checkout/_files/rollback_quote.php
180
203
* @magentoApiDataFixture Magento/Checkout/_files/active_quote_customer_not_default_store.php
181
204
*/
182
205
public function testGetCustomerCartSecondStore ()
0 commit comments