-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7383 from magento-gl/GL_Mainline_PR_07012022
Gl mainline pr 07012022
- Loading branch information
Showing
6 changed files
with
177 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...i-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchWithTranslatedMessageTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\GraphQl\Catalog; | ||
|
||
use Magento\TestFramework\TestCase\GraphQlAbstract; | ||
use Magento\TestFramework\Helper\CacheCleaner; | ||
|
||
/** | ||
* The GraphQl test for product in non default store with different locale | ||
*/ | ||
class ProductSearchWithTranslatedMessageTest extends GraphQlAbstract | ||
{ | ||
/** | ||
* Test translated error message in non default store | ||
* | ||
* @magentoApiDataFixture Magento/Store/_files/second_store.php | ||
* @magentoApiDataFixture Magento/Translation/_files/catalog_message_translate.php | ||
* @magentoConfigFixture fixture_second_store_store general/locale/code nl_NL | ||
*/ | ||
public function testErrorMessageTranslationInNonDefaultLocale() | ||
{ | ||
CacheCleaner::clean(['translate', 'config']); | ||
$storeCode = "fixture_second_store"; | ||
$header = ['Store' => $storeCode]; | ||
$this->expectException(\Exception::class); | ||
$this->expectExceptionMessage('currentPage-waarde moet groter zijn dan 0.'); | ||
$this->graphQlQuery($this->getQuery(), [], '', $header); | ||
} | ||
|
||
private function getQuery() | ||
{ | ||
return <<<QUERY | ||
{ | ||
products( currentPage: 0) { | ||
items { | ||
id | ||
name | ||
} | ||
} | ||
} | ||
QUERY; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
dev/tests/integration/testsuite/Magento/Translation/_files/catalog_message_translate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
/** @var \Magento\Translation\Model\ResourceModel\StringUtils $translateString */ | ||
$translateString = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( | ||
\Magento\Translation\Model\ResourceModel\StringUtils::class | ||
); | ||
$translateString->saveTranslate( | ||
'currentPage value must be greater than 0.', | ||
'currentPage-waarde moet groter zijn dan 0.', | ||
"nl_NL", | ||
0 | ||
); |
13 changes: 13 additions & 0 deletions
13
...s/integration/testsuite/Magento/Translation/_files/catalog_message_translate_rollback.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
/** @var \Magento\Translation\Model\ResourceModel\StringUtils $translateString */ | ||
$translateString = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( | ||
\Magento\Translation\Model\ResourceModel\StringUtils::class | ||
); | ||
$translateString->deleteTranslate('currentPage value must be greater than 0.', "nl_NL", 0); |