@@ -58,12 +58,7 @@ class PlaceOrderWithDhlUsCarrierTest extends TestCase
5858 * @var CartManagementInterface
5959 */
6060 private CartManagementInterface $ cartManagement ;
61-
62- /**
63- * @var AddressInterface
64- */
65- private AddressInterface $ address ;
66-
61+
6762 /**
6863 * @var OrderRepositoryInterface
6964 */
@@ -85,7 +80,6 @@ protected function setUp(): void
8580 $ this ->fixtures = $ this ->objectManager ->get (DataFixtureStorageManager::class)->getStorage ();
8681 $ this ->quoteRepository = $ this ->objectManager ->get (CartRepositoryInterface::class);
8782 $ this ->cartManagement = $ this ->objectManager ->get (CartManagementInterface::class);
88- $ this ->address = $ this ->objectManager ->get (AddressInterface::class);
8983 $ this ->orderRepository = $ this ->objectManager ->get (OrderRepositoryInterface::class);
9084 }
9185
@@ -161,17 +155,15 @@ protected function setUp(): void
161155 'selections ' => [['$product1.id$ ' ], ['$product2.id$ ' ]]
162156 ]
163157 ),
164-
165158 ]
166-
167159 /**
168160 * Verifies successful order placement using DHL-US shipping carrier
169161 */
170162 public function testPlaceOrderWithAllProductTypes ()
171163 {
172- $ cart = $ this ->fixtures ->get ('cart ' );
173- $ this ->setShippingAndBillingAddressForQuote (( int ) $ cart -> getId () );
174- $ orderId = $ this ->selectDhlAndCheckmoAndPlaceOrder (( int ) $ cart -> getId () );
164+ $ cartId = ( int ) $ this ->fixtures ->get ('cart ' )-> getId ( );
165+ $ this ->setShippingAndBillingAddressForQuote ($ cartId );
166+ $ orderId = $ this ->selectDhlAndCheckmoAndPlaceOrder ($ cartId );
175167 $ order = $ this ->orderRepository ->get ($ orderId );
176168 $ this ->assertNotEmpty ($ order ->getIncrementId ());
177169 $ this ->assertSame ('dhl_P ' , $ order ->getShippingMethod ());
@@ -219,6 +211,6 @@ private function selectDhlAndCheckmoAndPlaceOrder(int $cartId): int
219211 $ quote ->collectTotals ();
220212 $ quote ->getPayment ()->setMethod ('checkmo ' );
221213 $ this ->quoteRepository ->save ($ quote );
222- return (int ) $ this ->cartManagement ->placeOrder ($ quote ->getId ());
214+ return (int )$ this ->cartManagement ->placeOrder ($ quote ->getId ());
223215 }
224216}
0 commit comments