File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
app/code/Magento/DirectoryGraphQl/Model/Resolver
dev/tests/api-functional/testsuite/Magento/GraphQl/Directory Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments