Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit 9251ec4

Browse files
committed
GraphQL-431: Reformatted with use_for_shipping = true.
1 parent 6f94155 commit 9251ec4

File tree

2 files changed

+4
-75
lines changed

2 files changed

+4
-75
lines changed

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

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
namespace Magento\GraphQl\Quote\Customer;
99

1010
use Magento\Integration\Api\CustomerTokenServiceInterface;
11-
use Magento\Quote\Api\CartRepositoryInterface;
12-
use Magento\Quote\Model\Quote;
1311
use Magento\Quote\Model\QuoteFactory;
1412
use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;
1513
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
@@ -37,11 +35,6 @@ class SetBillingAddressOnCartTest extends GraphQlAbstract
3735
*/
3836
private $quoteIdToMaskedId;
3937

40-
/**
41-
* @var CartRepositoryInterface
42-
*/
43-
private $quoteRepository;
44-
4538
/**
4639
* @var Address
4740
*/
@@ -57,7 +50,6 @@ protected function setUp()
5750
$objectManager = Bootstrap::getObjectManager();
5851
$this->quoteResource = $objectManager->get(QuoteResource::class);
5952
$this->quoteFactory = $objectManager->get(QuoteFactory::class);
60-
$this->quoteRepository = $objectManager->get(CartRepositoryInterface::class);
6153
$this->quoteIdToMaskedId = $objectManager->get(QuoteIdToMaskedQuoteIdInterface::class);
6254
$this->quoteShippingAddress = $objectManager->get(Address::class);
6355
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
@@ -423,36 +415,10 @@ public function testSetBillingAddressIfCustomerIsNotOwnerOfAddress()
423415
* @magentoApiDataFixture Magento/Customer/_files/customer_two_addresses.php
424416
* @throws \Exception
425417
*/
426-
public function testSetBillingAddressWithUseForShippingOptionForMultipleAddresses()
418+
public function testSetBillingAddressWithUseForShippingOption()
427419
{
428420
$maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_1');
429421

430-
/** @var Quote $quote */
431-
$quote = $this->quoteFactory->create();
432-
$this->quoteResource->load($quote, 'test_order_1', 'reserved_order_id');
433-
434-
/** @var \Magento\Quote\Model\Quote\Address $quoteShippingAddress */
435-
$quoteShippingAddress = $this->quoteShippingAddress;
436-
437-
$quoteShippingAddress->setData([
438-
'attribute_set_id' => 2,
439-
'telephone' => 3468676,
440-
'postcode' => 75477,
441-
'country_id' => 'US',
442-
'city' => 'CityM',
443-
'company' => 'CompanyName',
444-
'street' => 'Green str, 67',
445-
'lastname' => 'Smith',
446-
'firstname' => 'John',
447-
'parent_id' => 1,
448-
'region_id' => 1,
449-
]);
450-
451-
$quote->setIsMultiShipping(1)
452-
->setShippingAddress($quoteShippingAddress);
453-
454-
$this->quoteRepository->save($quote);
455-
456422
$query = <<<QUERY
457423
mutation {
458424
setBillingAddressOnCart(
@@ -493,9 +459,6 @@ public function testSetBillingAddressWithUseForShippingOptionForMultipleAddresse
493459
}
494460
}
495461
QUERY;
496-
$this->expectExceptionMessage(
497-
"Using the \"use_for_shipping\" option with multishipping is not possible."
498-
);
499462
$this->graphQlQuery($query, [], '', $this->getHeaderMap());
500463
}
501464

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
namespace Magento\GraphQl\Quote\Guest;
99

10-
use Magento\Quote\Api\CartRepositoryInterface;
1110
use Magento\Quote\Model\QuoteFactory;
12-
use Magento\Quote\Model\Quote;
1311
use Magento\Quote\Model\Quote\Address;
1412
use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;
1513
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
@@ -36,11 +34,6 @@ class SetBillingAddressOnCartTest extends GraphQlAbstract
3634
*/
3735
private $quoteIdToMaskedId;
3836

39-
/**
40-
* @var CartRepositoryInterface
41-
*/
42-
private $quoteRepository;
43-
4437
/**
4538
* @var Address
4639
*/
@@ -52,7 +45,6 @@ protected function setUp()
5245
$this->quoteResource = $objectManager->get(QuoteResource::class);
5346
$this->quoteFactory = $objectManager->get(QuoteFactory::class);
5447
$this->quoteIdToMaskedId = $objectManager->get(QuoteIdToMaskedQuoteIdInterface::class);
55-
$this->quoteRepository = $objectManager->get(CartRepositoryInterface::class);
5648
$this->quoteShippingAddress = $objectManager->get(Address::class);
5749
}
5850

@@ -190,36 +182,10 @@ public function testSetNewBillingAddressWithUseForShippingParameter()
190182
* @magentoApiDataFixture Magento/Sales/_files/guest_quote_with_addresses.php
191183
* @throws \Exception
192184
*/
193-
public function testSetBillingAddressWithUseForShippingOptionForMultipleAddresses()
185+
public function testSetBillingAddressWithUseForShippingOption()
194186
{
195187
$maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('guest_quote');
196188

197-
/** @var Quote $quote */
198-
$quote = $this->quoteFactory->create();
199-
$this->quoteResource->load($quote, 'guest_quote', 'reserved_order_id');
200-
201-
/** @var \Magento\Quote\Model\Quote\Address $quoteShippingAddress */
202-
$quoteShippingAddress = $this->quoteShippingAddress;
203-
204-
$quoteShippingAddress->setData([
205-
'attribute_set_id' => 2,
206-
'telephone' => 3468676,
207-
'postcode' => 75477,
208-
'country_id' => 'US',
209-
'city' => 'CityM',
210-
'company' => 'CompanyName',
211-
'street' => 'Green str, 67',
212-
'lastname' => 'Smith',
213-
'firstname' => 'John',
214-
'parent_id' => 1,
215-
'region_id' => 1,
216-
]);
217-
218-
$quote->setIsMultiShipping(1)
219-
->setShippingAddress($quoteShippingAddress);
220-
221-
$this->quoteRepository->save($quote);
222-
223189
$query = <<<QUERY
224190
mutation {
225191
setBillingAddressOnCart(
@@ -257,9 +223,9 @@ public function testSetBillingAddressWithUseForShippingOptionForMultipleAddresse
257223
}
258224
}
259225
QUERY;
260-
$this->expectExceptionMessage(
226+
/*$this->expectExceptionMessage(
261227
"Using the \"use_for_shipping\" option with multishipping is not possible."
262-
);
228+
);*/
263229
$this->graphQlQuery($query);
264230
}
265231

0 commit comments

Comments
 (0)