|
16 | 16 | use Magento\Sales\Model\ResourceModel\Order\CollectionFactory; |
17 | 17 | use Magento\TestFramework\Helper\Bootstrap; |
18 | 18 | use Magento\TestFramework\TestCase\GraphQlAbstract; |
| 19 | +use Magento\TestFramework\Fixture\Config; |
| 20 | +use Magento\TestFramework\Fixture\DataFixture; |
19 | 21 |
|
20 | 22 | /** |
21 | 23 | * End to checkout tests for guest |
@@ -90,17 +92,16 @@ public function testCheckoutWorkflow() |
90 | 92 | /** |
91 | 93 | * Test checkout workflow with null second street in shipping address |
92 | 94 | * Validates that null values in street array are properly filtered and don't cause errors |
93 | | - * |
94 | | - * @magentoConfigFixture default_store checkout/options/guest_checkout 1 |
95 | | - * @magentoApiDataFixture Magento/Catalog/_files/products_with_layered_navigation_attribute.php |
96 | 95 | */ |
| 96 | + #[ |
| 97 | + Config('default_store', 'checkout/options/guest_checkout', 1), |
| 98 | + DataFixture('Magento/Catalog/_files/products_with_layered_navigation_attribute.php') |
| 99 | + ] |
97 | 100 | public function testCheckoutWithNullSecondStreetInShippingAddress() |
98 | 101 | { |
99 | | - $quantity = 1; |
100 | | - $sku = $this->findProduct(); |
101 | 102 | $cartId = $this->createEmptyCart(); |
102 | 103 | $this->setGuestEmailOnCart($cartId); |
103 | | - $this->addProductToCart($cartId, $quantity, $sku); |
| 104 | + $this->addProductToCart($cartId, 1, $this->findProduct()); |
104 | 105 |
|
105 | 106 | $shippingMethod = $this->setShippingAddressWithNullSecondStreet($cartId); |
106 | 107 |
|
@@ -478,31 +479,31 @@ private function setShippingAddressWithNullSecondStreet(string $cartId): array |
478 | 479 |
|
479 | 480 | $response = $this->graphQlMutation($query); |
480 | 481 |
|
481 | | - self::assertArrayHasKey('setShippingAddressesOnCart', $response); |
482 | | - self::assertArrayHasKey('cart', $response['setShippingAddressesOnCart']); |
483 | | - self::assertArrayHasKey('shipping_addresses', $response['setShippingAddressesOnCart']['cart']); |
484 | | - self::assertCount(1, $response['setShippingAddressesOnCart']['cart']['shipping_addresses']); |
| 482 | + $this->assertArrayHasKey('setShippingAddressesOnCart', $response); |
| 483 | + $this->assertArrayHasKey('cart', $response['setShippingAddressesOnCart']); |
| 484 | + $this->assertArrayHasKey('shipping_addresses', $response['setShippingAddressesOnCart']['cart']); |
| 485 | + $this->assertCount(1, $response['setShippingAddressesOnCart']['cart']['shipping_addresses']); |
485 | 486 |
|
486 | 487 | $shippingAddress = current($response['setShippingAddressesOnCart']['cart']['shipping_addresses']); |
487 | 488 |
|
488 | | - self::assertEquals('B', $shippingAddress['firstname']); |
489 | | - self::assertEquals('C', $shippingAddress['lastname']); |
490 | | - self::assertNull($shippingAddress['company']); |
491 | | - self::assertEquals(['Lorem ipsum dolor sit ame'], $shippingAddress['street']); |
492 | | - self::assertEquals('PARIS', $shippingAddress['city']); |
493 | | - self::assertEquals('56590', $shippingAddress['postcode']); |
494 | | - self::assertEquals('FR', $shippingAddress['country']['code']); |
495 | | - self::assertEquals('FR', $shippingAddress['country']['label']); |
496 | | - self::assertEquals('0601020304', $shippingAddress['telephone']); |
| 489 | + $this->assertEquals('B', $shippingAddress['firstname']); |
| 490 | + $this->assertEquals('C', $shippingAddress['lastname']); |
| 491 | + $this->assertNull($shippingAddress['company']); |
| 492 | + $this->assertEquals(['Lorem ipsum dolor sit ame'], $shippingAddress['street']); |
| 493 | + $this->assertEquals('PARIS', $shippingAddress['city']); |
| 494 | + $this->assertEquals('56590', $shippingAddress['postcode']); |
| 495 | + $this->assertEquals('FR', $shippingAddress['country']['code']); |
| 496 | + $this->assertEquals('FR', $shippingAddress['country']['label']); |
| 497 | + $this->assertEquals('0601020304', $shippingAddress['telephone']); |
497 | 498 |
|
498 | | - self::assertArrayHasKey('available_shipping_methods', $shippingAddress); |
499 | | - self::assertGreaterThan(0, count($shippingAddress['available_shipping_methods'])); |
| 499 | + $this->assertArrayHasKey('available_shipping_methods', $shippingAddress); |
| 500 | + $this->assertGreaterThan(0, count($shippingAddress['available_shipping_methods'])); |
500 | 501 |
|
501 | 502 | $availableShippingMethod = current($shippingAddress['available_shipping_methods']); |
502 | | - self::assertArrayHasKey('carrier_code', $availableShippingMethod); |
503 | | - self::assertNotEmpty($availableShippingMethod['carrier_code']); |
504 | | - self::assertArrayHasKey('method_code', $availableShippingMethod); |
505 | | - self::assertNotEmpty($availableShippingMethod['method_code']); |
| 503 | + $this->assertArrayHasKey('carrier_code', $availableShippingMethod); |
| 504 | + $this->assertNotEmpty($availableShippingMethod['carrier_code']); |
| 505 | + $this->assertArrayHasKey('method_code', $availableShippingMethod); |
| 506 | + $this->assertNotEmpty($availableShippingMethod['method_code']); |
506 | 507 |
|
507 | 508 | return $availableShippingMethod; |
508 | 509 | } |
|
0 commit comments