Skip to content

Commit 3d465fb

Browse files
committed
Merge remote-tracking branch 'origin/ACP2E-428' into L3_Arrows_PR_20220314
2 parents fb2f3af + 275e8b8 commit 3d465fb

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

app/code/Magento/DirectoryGraphQl/Model/Resolver/Countries.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ public function resolve(
5555

5656
$output = [];
5757
foreach ($countries as $country) {
58-
$output[] = $this->dataProcessor->buildOutputDataArray($country, CountryInformationInterface::class);
58+
if (!empty($country->getFullNameLocale())) {
59+
$output[] = $this->dataProcessor->buildOutputDataArray($country, CountryInformationInterface::class);
60+
}
5961
}
6062

6163
return $output;

dev/tests/api-functional/testsuite/Magento/GraphQl/Directory/CountriesTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,30 @@ public function testGetCountries()
4242
$this->assertArrayHasKey('full_name_english', $result['countries'][0]);
4343
$this->assertArrayHasKey('available_regions', $result['countries'][0]);
4444
}
45+
46+
public function testCheckCountriesForNullLocale()
47+
{
48+
$query = <<<QUERY
49+
query {
50+
countries {
51+
id
52+
two_letter_abbreviation
53+
three_letter_abbreviation
54+
full_name_locale
55+
full_name_english
56+
available_regions {
57+
id
58+
code
59+
name
60+
}
61+
}
62+
}
63+
QUERY;
64+
65+
$result = $this->graphQlQuery($query);
66+
$count = count($result['countries']);
67+
for ($i=0; $i < $count; $i++) {
68+
$this->assertNotNull($result['countries'][$i]['full_name_locale']);
69+
}
70+
}
4571
}

0 commit comments

Comments
 (0)