Skip to content

Commit 6b2406d

Browse files
ACQE-8552: [AC-5466] Use DHL (US) Online Shipping Carrier on Checkout as a Registered Customer
- Rectified the code.
1 parent 9b9c710 commit 6b2406d

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

dev/tests/integration/testsuite/Magento/Dhl/PlaceOrderWithDhlUsCarrierTest.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
use Magento\ConfigurableProduct\Test\Fixture\Attribute as AttributeFixture;
1313
use Magento\ConfigurableProduct\Test\Fixture\Product as ConfigurableProductFixture;
1414
use Magento\Customer\Test\Fixture\Customer as CustomerFixture;
15-
use Magento\Framework\Exception\NoSuchEntityException;
1615
use Magento\Quote\Test\Fixture\AddProductToCart as AddProductToCartFixture;
1716
use Magento\Quote\Test\Fixture\CustomerCart as CustomerCartFixture;
18-
use Magento\TestFramework\Fixture\Config as Config;
17+
use Magento\TestFramework\Fixture\Config;
1918
use Magento\TestFramework\Fixture\DataFixture;
2019
use Magento\TestFramework\Fixture\DataFixtureStorageManager;
2120
use Magento\TestFramework\Fixture\DataFixtureStorage;
@@ -40,7 +39,6 @@
4039
* @magentoDbIsolation disabled
4140
* @magentoAppIsolation enabled
4241
* @magentoAppArea frontend
43-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
4442
*/
4543
class PlaceOrderWithDhlUsCarrierTest extends TestCase
4644
{
@@ -58,7 +56,7 @@ class PlaceOrderWithDhlUsCarrierTest extends TestCase
5856
* @var CartManagementInterface
5957
*/
6058
private CartManagementInterface $cartManagement;
61-
59+
6260
/**
6361
* @var OrderRepositoryInterface
6462
*/
@@ -158,13 +156,14 @@ protected function setUp(): void
158156
]
159157
/**
160158
* Verifies successful order placement using DHL-US shipping carrier
159+
*
160+
* @return void
161161
*/
162-
public function testPlaceOrderWithAllProductTypes()
162+
public function testPlaceOrderWithDhlUsCarrierTest(): void
163163
{
164164
$cartId = (int)$this->fixtures->get('cart')->getId();
165165
$this->setShippingAndBillingAddressForQuote($cartId);
166-
$orderId = $this->selectDhlAndCheckmoAndPlaceOrder($cartId);
167-
$order = $this->orderRepository->get($orderId);
166+
$order = $this->orderRepository->get($this->selectDhlAndCheckmoAndPlaceOrder($cartId));
168167
$this->assertNotEmpty($order->getIncrementId());
169168
$this->assertSame('dhl_P', $order->getShippingMethod());
170169
}
@@ -174,7 +173,6 @@ public function testPlaceOrderWithAllProductTypes()
174173
*
175174
* @param int $cartId
176175
* @return void
177-
* @throws NoSuchEntityException
178176
*/
179177
private function setShippingAndBillingAddressForQuote(int $cartId): void
180178
{
@@ -200,9 +198,6 @@ private function setShippingAndBillingAddressForQuote(int $cartId): void
200198
*
201199
* @param int $cartId
202200
* @return int $cartId
203-
* @throws CouldNotSaveException
204-
* @throws InputException
205-
* @throws NoSuchEntityException
206201
*/
207202
private function selectDhlAndCheckmoAndPlaceOrder(int $cartId): int
208203
{

0 commit comments

Comments
 (0)