Skip to content

Commit c295e54

Browse files
committed
Issue-230: adding varnish
- fixing messages
1 parent 98c65c0 commit c295e54

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

app/code/Magento/DirectoryGraphQl/Controller/HttpRequestValidator/CurrencyValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ public function validate(HttpRequestInterface $request): void
4848
$currentStore = $this->storeManager->getStore();
4949
if (!in_array($headerCurrency, $currentStore->getAvailableCurrencyCodes(true))) {
5050
throw new GraphQlInputException(
51-
__('Currency not allowed for store %1', [$currentStore->getCode()])
51+
__('Please correct the target currency')
5252
);
5353
}
5454
}
5555
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
5656
$this->storeManager->setCurrentStore(null);
5757
throw new GraphQlInputException(
58-
__("The store that was requested wasn't found. Verify the store and try again.")
58+
__("Requested store is not found")
5959
);
6060
}
6161
}

app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function validate(HttpRequestInterface $request): void
4848
if (strtolower($storeCode) !== 'default') {
4949
$this->storeManager->setCurrentStore(null);
5050
throw new GraphQlInputException(
51-
__("The store that was requested wasn't found. Verify the store and try again.")
51+
__("Requested store is not found")
5252
);
5353
}
5454
}

dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductInMultipleStoresTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function testProductFromSpecificAndDefaultStore()
9797
$nonExistingStoreCode = "non_existent_store";
9898
$headerMapInvalidStoreCode = ['Store' => $nonExistingStoreCode];
9999
$this->expectException(\Exception::class);
100-
$this->expectExceptionMessage('The store that was requested wasn\'t found. Verify the store and try again.');
100+
$this->expectExceptionMessage('Requested store is not found');
101101
$this->graphQlQuery($query, [], '', $headerMapInvalidStoreCode);
102102
}
103103
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrencyNonExisti
118118

119119
//test non existing currency
120120
$headerMap = ['Store' => 'default', 'Content-Currency' => 'someNonExistentCurrency'];
121-
$this->expectExceptionMessage('GraphQL response contains errors: Currency not allowed for store default');
121+
$this->expectExceptionMessage('GraphQL response contains errors: Please correct the target currency');
122122
$this->graphQlQuery($query, [], '', $headerMap);
123123
}
124124

@@ -166,7 +166,7 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrencyNotAllowe
166166
//test not allowed existing currency
167167
$headerMap = ['Store' => $storeCodeFromFixture, 'Content-Currency' => 'CAD'];
168168
$this->expectExceptionMessage(
169-
"GraphQL response contains errors: Currency not allowed for store {$storeCodeFromFixture}"
169+
'GraphQL response contains errors: Please correct the target currency'
170170
);
171171
$this->graphQlQuery($query, [], '', $headerMap);
172172
}
@@ -315,7 +315,7 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency()
315315
// test cached response store + currency header with non existing currency, and no valid response, no cache
316316
$headerMap = ['Store' => $storeCodeFromFixture, 'Content-Currency' => 'SOMECURRENCY'];
317317
$this->expectExceptionMessage(
318-
"GraphQL response contains errors: Currency not allowed for store {$storeCodeFromFixture}"
318+
'GraphQL response contains errors: Please correct the target currency'
319319
);
320320
$this->graphQlQuery($query, [], '', $headerMap);
321321
}

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function testGetCartWithWrongStore()
163163
* @magentoApiDataFixture Magento/Checkout/_files/active_quote_customer_not_default_store.php
164164
*
165165
* @expectedException \Exception
166-
* @expectedExceptionMessage The store that was requested wasn't found. Verify the store and try again.
166+
* @expectedExceptionMessage Requested store is not found
167167
*/
168168
public function testGetCartWithNotExistingStore()
169169
{

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function testGetCartWithWrongStore()
133133
* @magentoApiDataFixture Magento/Checkout/_files/active_quote_guest_not_default_store.php
134134
*
135135
* @expectedException \Exception
136-
* @expectedExceptionMessage The store that was requested wasn't found. Verify the store and try again.
136+
* @expectedExceptionMessage Requested store is not found
137137
*/
138138
public function testGetCartWithNotExistingStore()
139139
{

0 commit comments

Comments
 (0)