@@ -54,6 +54,7 @@ public function testGetActiveCustomerCart()
54
54
$ this ->assertNotEmpty ($ response ['customerCart ' ]['items ' ]);
55
55
$ this ->assertEquals (2 , $ response ['customerCart ' ]['total_quantity ' ]);
56
56
$ this ->assertArrayHasKey ('id ' , $ response ['customerCart ' ]);
57
+ $ this ->assertNotEmpty ($ response ['customerCart ' ]['id ' ]);
57
58
$ this ->assertEquals ($ maskedQuoteId , $ response ['customerCart ' ]['id ' ]);
58
59
$ this ->assertEquals (
59
60
$ quantity ,
@@ -62,6 +63,26 @@ public function testGetActiveCustomerCart()
62
63
);
63
64
}
64
65
66
+ /**
67
+ * Query for an existing customer cart with no masked quote id
68
+ *
69
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
70
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
71
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart_without_maskedQuoteId.php
72
+ */
73
+ public function testGetLoggedInCustomerCartWithoutMaskedQuoteId ()
74
+ {
75
+ $ customerCartQuery = $ this ->getCustomerCartQuery ();
76
+ $ response = $ this ->graphQlQuery ($ customerCartQuery , [], '' , $ this ->getHeaderMap ());
77
+ $ this ->assertArrayHasKey ('customerCart ' , $ response );
78
+ $ this ->assertArrayHasKey ('items ' , $ response ['customerCart ' ]);
79
+ $ this ->assertEmpty ($ response ['customerCart ' ]['items ' ]);
80
+ $ this ->assertEquals (0 , $ response ['customerCart ' ]['total_quantity ' ]);
81
+ $ this ->assertArrayHasKey ('id ' , $ response ['customerCart ' ]);
82
+ $ this ->assertNotEmpty ($ response ['customerCart ' ]['id ' ]);
83
+ $ this ->assertNotNull ($ response ['customerCart ' ]['id ' ]);
84
+ }
85
+
65
86
/**
66
87
* Query for customer cart for a user with no existing active cart
67
88
*
@@ -76,6 +97,7 @@ public function testGetNewCustomerCart()
76
97
$ this ->assertArrayHasKey ('customerCart ' , $ response );
77
98
$ this ->assertArrayHasKey ('id ' , $ response ['customerCart ' ]);
78
99
$ this ->assertNotNull ($ response ['customerCart ' ]['id ' ]);
100
+ $ this ->assertNotEmpty ($ response ['customerCart ' ]['id ' ]);
79
101
$ this ->assertEmpty ($ response ['customerCart ' ]['items ' ]);
80
102
$ this ->assertEquals (0 , $ response ['customerCart ' ]['total_quantity ' ]);
81
103
}
@@ -106,6 +128,7 @@ public function testGetCustomerCartAfterTokenRevoked()
106
128
$ this ->assertArrayHasKey ('customerCart ' , $ response );
107
129
$ this ->assertArrayHasKey ('id ' , $ response ['customerCart ' ]);
108
130
$ this ->assertNotNull ($ response ['customerCart ' ]['id ' ]);
131
+ $ this ->assertNotEmpty ($ response ['customerCart ' ]['id ' ]);
109
132
$ this ->revokeCustomerToken ();
110
133
$ customerCartQuery = $ this ->getCustomerCartQuery ();
111
134
$ this ->expectExceptionMessage (
0 commit comments