Skip to content

Commit c662e98

Browse files
committed
ACP2E-636: Cannot get graphql customer token
1 parent 16788b8 commit c662e98

File tree

9 files changed

+66
-185
lines changed

9 files changed

+66
-185
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomerGraphQl/GenerateLoginCustomerTokenTest.php

100644100755
Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -62,34 +62,6 @@ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled()
6262
$this->assertIsArray($response['generateCustomerTokenAsAdmin']);
6363
}
6464

65-
/**
66-
* Verify customer token as admin with store
67-
*
68-
* @magentoApiDataFixture Magento/LoginAsCustomer/_files/admin.php
69-
* @magentoConfigFixture admin_store login_as_customer/general/enabled 1
70-
* @magentoApiDataFixture Magento/LoginAsCustomer/_files/customer_with_second_store.php
71-
* @throws Exception
72-
*/
73-
public function testGenerateCustomerValidTokenAsAdminWithStore()
74-
{
75-
$customerEmail = '[email protected]';
76-
77-
$mutation = $this->getQuery($customerEmail);
78-
79-
$response = $this->graphQlMutation(
80-
$mutation,
81-
[],
82-
'',
83-
$this->getAdminHeaderAuthenticationWithStore(
84-
'TestAdmin1',
85-
\Magento\TestFramework\Bootstrap::ADMIN_PASSWORD,
86-
'fixture_second_store'
87-
)
88-
);
89-
$this->assertArrayHasKey('generateCustomerTokenAsAdmin', $response);
90-
$this->assertIsArray($response['generateCustomerTokenAsAdmin']);
91-
}
92-
9365
/**
9466
* Verify with Admin email ID and Magento_LoginAsCustomer::login is disabled
9567
*
@@ -252,28 +224,4 @@ private function getAdminHeaderAuthentication(string $userName, string $password
252224
);
253225
}
254226
}
255-
256-
/**
257-
* To get admin access token with store
258-
*
259-
* @param string $userName
260-
* @param string $password
261-
* @param string $storeCode
262-
* @return string[]
263-
* @throws AuthenticationException
264-
*/
265-
private function getAdminHeaderAuthenticationWithStore(string $userName, string $password, string $storeCode)
266-
{
267-
try {
268-
$adminAccessToken = $this->adminTokenService->createAdminAccessToken($userName, $password);
269-
return ['Authorization' => 'Bearer ' . $adminAccessToken, 'store' => $storeCode];
270-
} catch (\Exception $e) {
271-
throw new AuthenticationException(
272-
__(
273-
'The account sign-in was incorrect or your account is disabled temporarily. '
274-
. 'Please wait and try again later.'
275-
)
276-
);
277-
}
278-
}
279227
}

dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/ProductInMultipleStoresCacheTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency()
298298
'Product name in fixture store is invalid.'
299299
);
300300
$this->assertEquals(
301-
'EUR',
301+
'USD',
302302
$response['products']['items'][0]['price']['minimalPrice']['amount']['currency'],
303-
'Currency code EUR in fixture store default is unexpected'
303+
'Currency code USD in fixture store default is unexpected'
304304
);
305305

306306
// test cached response store + currency header with non existing currency, and no valid response, no cache

dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -284,16 +284,16 @@ private function assertBaseFields($product, $actualResponse)
284284
[
285285
'minimalPrice' => [
286286
'amount' => [
287-
'value' => 8.213,
288-
'currency' => 'EUR'
287+
'value' => 4.1065,
288+
'currency' => 'USD'
289289
],
290290
'adjustments' => [
291291
0 =>
292292
[
293293
'amount' =>
294294
[
295-
'value' => 0.573,
296-
'currency' => 'EUR',
295+
'value' => 0.2865,
296+
'currency' => 'USD',
297297
],
298298
'code' => 'TAX',
299299
'description' => 'INCLUDED',
@@ -302,16 +302,16 @@ private function assertBaseFields($product, $actualResponse)
302302
],
303303
'regularPrice' => [
304304
'amount' => [
305-
'value' => 21.5,
306-
'currency' => 'EUR'
305+
'value' => 10.7500,
306+
'currency' => 'USD'
307307
],
308308
'adjustments' => [
309309
0 =>
310310
[
311311
'amount' =>
312312
[
313-
'value' => 1.5,
314-
'currency' => 'EUR',
313+
'value' => 0.7500,
314+
'currency' => 'USD',
315315
],
316316
'code' => 'TAX',
317317
'description' => 'INCLUDED',
@@ -320,16 +320,16 @@ private function assertBaseFields($product, $actualResponse)
320320
],
321321
'maximalPrice' => [
322322
'amount' => [
323-
'value' => 8.213,
324-
'currency' => 'EUR'
323+
'value' => 4.1065,
324+
'currency' => 'USD'
325325
],
326326
'adjustments' => [
327327
0 =>
328328
[
329329
'amount' =>
330330
[
331-
'value' => 0.573,
332-
'currency' => 'EUR',
331+
'value' => 0.2865,
332+
'currency' => 'USD',
333333
],
334334
'code' => 'TAX',
335335
'description' => 'INCLUDED',

dev/tests/api-functional/testsuite/Magento/GraphQl/VariablesSupportQueryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected function setUp(): void
2929
public function testQueryObjectVariablesSupport()
3030
{
3131
$productSku = 'simple-249';
32-
$minPrice = 306;
32+
$minPrice = 153;
3333

3434
$query
3535
= <<<'QUERY'

dev/tests/api-functional/testsuite/Magento/GraphQl/Weee/CartItemPricesWithFPTTest.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -132,27 +132,27 @@ public function cartItemFixedProductTaxDataProvider(): array
132132
[
133133
'taxSettings' => [
134134
'tax/weee/enable' => '1',
135-
'tax/weee/apply_vat' => ' 0',
135+
'tax/weee/apply_vat' => '0',
136136
'tax/calculation/price_includes_tax' => '0',
137137
'tax/display/type' => '1',
138138
],
139139
'expectedFtps' => [
140140
[
141141
'label' => 'fixed_product_attribute_front_label',
142142
'amount' => [
143-
'value' => 20.0
143+
'value' => 10.0
144144
]
145145
],
146146
[
147147
'label' => 'fpt_for_all_front_label',
148148
'amount' => [
149-
'value' => 25.4
149+
'value' => 12.7
150150
]
151151
],
152152
[
153153
'label' => 'fixed_product_attribute_front_label',
154154
'amount' => [
155-
'value' => 10.0
155+
'value' => 5.0
156156
]
157157
],
158158
]
@@ -168,19 +168,19 @@ public function cartItemFixedProductTaxDataProvider(): array
168168
[
169169
'label' => 'fixed_product_attribute_front_label',
170170
'amount' => [
171-
'value' => 20.0
171+
'value' => 10.0
172172
]
173173
],
174174
[
175175
'label' => 'fpt_for_all_front_label',
176176
'amount' => [
177-
'value' => 25.4
177+
'value' => 12.7
178178
]
179179
],
180180
[
181181
'label' => 'fixed_product_attribute_front_label',
182182
'amount' => [
183-
'value' => 10.0
183+
'value' => 5.0
184184
]
185185
],
186186
]
@@ -196,19 +196,19 @@ public function cartItemFixedProductTaxDataProvider(): array
196196
[
197197
'label' => 'fixed_product_attribute_front_label',
198198
'amount' => [
199-
'value' => 20.0
199+
'value' => 10.0
200200
]
201201
],
202202
[
203203
'label' => 'fpt_for_all_front_label',
204204
'amount' => [
205-
'value' => 25.4
205+
'value' => 12.7
206206
]
207207
],
208208
[
209209
'label' => 'fixed_product_attribute_front_label',
210210
'amount' => [
211-
'value' => 10
211+
'value' => 5.0
212212
]
213213
],
214214
]
@@ -224,19 +224,19 @@ public function cartItemFixedProductTaxDataProvider(): array
224224
[
225225
'label' => 'fixed_product_attribute_front_label',
226226
'amount' => [
227-
'value' => 21.5
227+
'value' => 10.75
228228
]
229229
],
230230
[
231231
'label' => 'fpt_for_all_front_label',
232232
'amount' => [
233-
'value' => 27.31
233+
'value' => 13.66
234234
]
235235
],
236236
[
237237
'label' => 'fixed_product_attribute_front_label',
238238
'amount' => [
239-
'value' => 10.75
239+
'value' => 5.38
240240
]
241241
],
242242
]
@@ -252,19 +252,19 @@ public function cartItemFixedProductTaxDataProvider(): array
252252
[
253253
'label' => 'fixed_product_attribute_front_label',
254254
'amount' => [
255-
'value' => 20
255+
'value' => 10.0
256256
]
257257
],
258258
[
259259
'label' => 'fpt_for_all_front_label',
260260
'amount' => [
261-
'value' => 25.41
261+
'value' => 12.7
262262
]
263263
],
264264
[
265265
'label' => 'fixed_product_attribute_front_label',
266266
'amount' => [
267-
'value' => 10
267+
'value' => 5.01
268268
]
269269
],
270270
]
@@ -280,19 +280,19 @@ public function cartItemFixedProductTaxDataProvider(): array
280280
[
281281
'label' => 'fixed_product_attribute_front_label',
282282
'amount' => [
283-
'value' => 21.5
283+
'value' => 10.75
284284
]
285285
],
286286
[
287287
'label' => 'fpt_for_all_front_label',
288288
'amount' => [
289-
'value' => 27.31
289+
'value' => 13.65
290290
]
291291
],
292292
[
293293
'label' => 'fixed_product_attribute_front_label',
294294
'amount' => [
295-
'value' => 10.75
295+
'value' => 5.38
296296
]
297297
],
298298
]

0 commit comments

Comments
 (0)