Skip to content

Commit 01e0686

Browse files
[Magento Community Engineering] Community Contributions - 2.4-develop
- merged latest code from mainline branch
2 parents ddf2a8a + 1fdd709 commit 01e0686

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCustomerCartTest.php

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId;
1212
use Magento\Integration\Api\CustomerTokenServiceInterface;
1313
use Magento\TestFramework\Helper\Bootstrap;
14+
use Magento\Quote\Model\ResourceModel\Quote\Collection;
15+
use Magento\Framework\ObjectManagerInterface;
1416
use Magento\TestFramework\TestCase\GraphQlAbstract;
1517

1618
/**
@@ -28,11 +30,29 @@ class GetCustomerCartTest extends GraphQlAbstract
2830
*/
2931
private $customerTokenService;
3032

33+
/**
34+
* @var ObjectManagerInterface
35+
*/
36+
private $objectManager;
37+
3138
protected function setUp()
3239
{
33-
$objectManager = Bootstrap::getObjectManager();
34-
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
35-
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
40+
$this->objectManager = Bootstrap::getObjectManager();
41+
$this->getMaskedQuoteIdByReservedOrderId = $this->objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
42+
$this->customerTokenService = $this->objectManager->get(CustomerTokenServiceInterface::class);
43+
}
44+
45+
/**
46+
* @inheritdoc
47+
*/
48+
protected function tearDown()
49+
{
50+
/** @var \Magento\Quote\Model\Quote $quote */
51+
$quoteCollection = $this->objectManager->create(Collection::class);
52+
foreach ($quoteCollection as $quote) {
53+
$quote->delete();
54+
}
55+
parent::tearDown();
3656
}
3757

3858
/**
@@ -177,9 +197,8 @@ public function testGetInactiveCustomerCart()
177197
*/
178198
public function testGetCustomerCartSecondStore()
179199
{
180-
$maskedQuoteIdSecondStore = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1_not_default_store');
181200
$customerCartQuery = $this->getCustomerCartQuery();
182-
201+
$maskedQuoteIdSecondStore = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1_not_default_store');
183202
$headerMap = $this->getHeaderMap();
184203
$headerMap['Store'] = 'fixture_second_store';
185204
$responseSecondStore = $this->graphQlQuery($customerCartQuery, [], '', $headerMap);

0 commit comments

Comments
 (0)