Skip to content

Commit c2c04e9

Browse files
committed
magento/graphql-ce#544: Replace deprecated fixtures in RemoveItemFromCartTest
1 parent 212a533 commit c2c04e9

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

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

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,15 @@ protected function setUp()
5656
}
5757

5858
/**
59-
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
59+
* @magentoApiDataFixture Magento/Customer/_files/customer.php
60+
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
61+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
62+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
6063
*/
6164
public function testRemoveItemFromCart()
6265
{
6366
$quote = $this->quoteFactory->create();
64-
$this->quoteResource->load($quote, 'test_order_1', 'reserved_order_id');
67+
$this->quoteResource->load($quote, 'test_quote', 'reserved_order_id');
6568
$maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$quote->getId());
6669
$itemId = (int)$quote->getItemByProduct($this->productRepository->get('simple'))->getId();
6770

@@ -85,12 +88,15 @@ public function testRemoveItemFromNonExistentCart()
8588
}
8689

8790
/**
88-
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
91+
* @magentoApiDataFixture Magento/Customer/_files/customer.php
92+
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
93+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
94+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
8995
*/
9096
public function testRemoveNonExistentItem()
9197
{
9298
$quote = $this->quoteFactory->create();
93-
$this->quoteResource->load($quote, 'test_order_1', 'reserved_order_id');
99+
$this->quoteResource->load($quote, 'test_quote', 'reserved_order_id');
94100
$maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$quote->getId());
95101
$notExistentItemId = 999;
96102

@@ -101,13 +107,16 @@ public function testRemoveNonExistentItem()
101107
}
102108

103109
/**
104-
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
110+
* @magentoApiDataFixture Magento/Customer/_files/customer.php
111+
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
112+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
113+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
105114
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_virtual_product_saved.php
106115
*/
107116
public function testRemoveItemIfItemIsNotBelongToCart()
108117
{
109118
$firstQuote = $this->quoteFactory->create();
110-
$this->quoteResource->load($firstQuote, 'test_order_1', 'reserved_order_id');
119+
$this->quoteResource->load($firstQuote, 'test_quote', 'reserved_order_id');
111120
$firstQuoteMaskedId = $this->quoteIdToMaskedId->execute((int)$firstQuote->getId());
112121

113122
$secondQuote = $this->quoteFactory->create();
@@ -130,14 +139,16 @@ public function testRemoveItemIfItemIsNotBelongToCart()
130139

131140
/**
132141
* @magentoApiDataFixture Magento/Customer/_files/customer.php
133-
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_virtual_product_saved.php
142+
* @magentoApiDataFixture Magento/Catalog/_files/product_virtual.php
143+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
144+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_virtual_product.php
134145
*/
135146
public function testRemoveItemFromGuestCart()
136147
{
137148
$guestQuote = $this->quoteFactory->create();
138149
$this->quoteResource->load(
139150
$guestQuote,
140-
'test_order_with_virtual_product_without_address',
151+
'test_quote',
141152
'reserved_order_id'
142153
);
143154
$guestQuoteMaskedId = $this->quoteIdToMaskedId->execute((int)$guestQuote->getId());
@@ -154,8 +165,11 @@ public function testRemoveItemFromGuestCart()
154165
}
155166

156167
/**
168+
* @magentoApiDataFixture Magento/Customer/_files/customer.php
169+
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
170+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
171+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
157172
* @magentoApiDataFixture Magento/Customer/_files/three_customers.php
158-
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
159173
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_virtual_product_saved.php
160174
*/
161175
public function testRemoveItemFromAnotherCustomerCart()

0 commit comments

Comments
 (0)