@@ -242,20 +242,17 @@ public function testGetRegionJson(?int $currentStoreId, array $allowedCountries,
242242 [Data::XML_PATH_STATES_REQUIRED , ScopeInterface::SCOPE_STORE , null , '' ]
243243 ]
244244 );
245+
245246 $ regions = [
246- new DataObject (
247- ['country_id ' => 'Country1 ' , 'region_id ' => 'r1 ' , 'code ' => 'r1-code ' , 'name ' => 'r1-name ' ]
248- ),
249- new DataObject (
250- ['country_id ' => 'Country1 ' , 'region_id ' => 'r2 ' , 'code ' => 'r2-code ' , 'name ' => 'r2-name ' ]
251- ),
252- new DataObject (
253- ['country_id ' => 'Country2 ' , 'region_id ' => 'r3 ' , 'code ' => 'r3-code ' , 'name ' => 'r3-name ' ]
254- )
247+ new DataObject (['country_id ' => 'Country1 ' , 'region_id ' => 'r1 ' , 'code ' => 'r1-code ' , 'name ' => 'r1-name ' ]),
248+ new DataObject (['country_id ' => 'Country1 ' , 'region_id ' => 'r2 ' , 'code ' => 'r2-code ' , 'name ' => 'r2-name ' ]),
249+ new DataObject (['country_id ' => 'Country2 ' , 'region_id ' => 'r3 ' , 'code ' => 'r3-code ' , 'name ' => 'r3-name ' ]),
255250 ];
256- $ regionIterator = new ArrayIterator ( array_filter ($ regions , function (DataObject $ region ) use ($ allowedCountries ) {
251+ $ regions = array_filter ($ regions , function (DataObject $ region ) use ($ allowedCountries ) {
257252 return array_key_exists ($ region ->getData ('country_id ' ), $ allowedCountries );
258- }));
253+ });
254+
255+ $ regionIterator = new ArrayIterator ($ regions );
259256
260257 $ this ->_regionCollection ->expects (
261258 $ this ->once ()
0 commit comments