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(
55
55
56
56
$ output = [];
57
57
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
+ }
59
61
}
60
62
61
63
return $ output ;
Original file line number Diff line number Diff line change @@ -42,4 +42,30 @@ public function testGetCountries()
42
42
$ this ->assertArrayHasKey ('full_name_english ' , $ result ['countries ' ][0 ]);
43
43
$ this ->assertArrayHasKey ('available_regions ' , $ result ['countries ' ][0 ]);
44
44
}
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
+ }
45
71
}
You can’t perform that action at this time.
0 commit comments