Skip to content

Commit

Permalink
magento/magento2#: GraphQl mutation. Additional test coverage for cus…
Browse files Browse the repository at this point in the history
…tomer storeConfig settings.
  • Loading branch information
atwixfirster committed Jun 17, 2020
1 parent 29e1368 commit 3c76f6b
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,37 @@
class StoreConfigTest extends GraphQlAbstract
{
/**
* Check type of autocomplete_on_storefront storeConfig value
*
* @magentoConfigFixture default_store customer/password/autocomplete_on_storefront 1
* @magentoConfigFixture default_store customer/password/minimum_password_length 6
* @magentoConfigFixture default_store customer/password/required_character_classes_number 2
*
* @throws Exception
*/
public function testReturnTypeAutocompleteOnStorefrontConfig()
public function testGetCustomerStoreConfig()
{
$minimumPasswordLength = 6;
$requiredCharacterClassesNumber = 2;

$query = <<<QUERY
{
storeConfig {
autocomplete_on_storefront
minimum_password_length
required_character_classes_number
}
}
QUERY;
$response = $this->graphQlQuery($query);
self::assertArrayHasKey('autocomplete_on_storefront', $response['storeConfig']);
self::assertTrue($response['storeConfig']['autocomplete_on_storefront']);

self::assertArrayHasKey('minimum_password_length', $response['storeConfig']);
self::assertEquals($response['storeConfig']['minimum_password_length'], $minimumPasswordLength);

self::assertArrayHasKey('required_character_classes_number', $response['storeConfig']);
self::assertEquals(
$response['storeConfig']['required_character_classes_number'],
$requiredCharacterClassesNumber
);
}
}

0 comments on commit 3c76f6b

Please sign in to comment.