77
88namespace Magento \GraphQl \Store ;
99
10+ use Magento \Framework \App \Config \ScopeConfigInterface ;
1011use Magento \Framework \ObjectManagerInterface ;
1112use Magento \Store \Api \Data \StoreConfigInterface ;
1213use Magento \Store \Api \StoreConfigManagerInterface ;
1314use Magento \Store \Model \ResourceModel \Store as StoreResource ;
15+ use Magento \Store \Model \ScopeInterface ;
1416use Magento \Store \Model \Store ;
1517use Magento \TestFramework \Helper \Bootstrap ;
1618use Magento \TestFramework \TestCase \GraphQlAbstract ;
@@ -175,6 +177,8 @@ private function validateStoreConfig(StoreConfigInterface $storeConfig, array $r
175177 /** @var Store $store */
176178 $ store = $ this ->objectManager ->get (Store::class);
177179 $ this ->storeResource ->load ($ store , $ storeConfig ->getCode (), 'code ' );
180+ /* @var $scopeConfig ScopeConfigInterface */
181+ $ scopeConfig = $ this ->objectManager ->get (ScopeConfigInterface::class);
178182 $ this ->assertEquals ($ storeConfig ->getId (), $ responseConfig ['id ' ]);
179183 $ this ->assertEquals ($ storeConfig ->getCode (), $ responseConfig ['code ' ]);
180184 $ this ->assertEquals ($ store ->getName (), $ responseConfig ['store_name ' ]);
@@ -200,12 +204,28 @@ private function validateStoreConfig(StoreConfigInterface $storeConfig, array $r
200204 );
201205 $ this ->assertEquals ($ storeConfig ->getTimezone (), $ responseConfig ['timezone ' ]);
202206 $ this ->assertEquals ($ storeConfig ->getWeightUnit (), $ responseConfig ['weight_unit ' ]);
203- $ this ->assertEquals ($ storeConfig ->getBaseUrl (), $ responseConfig ['base_url ' ]);
204- $ this ->assertEquals ($ storeConfig ->getBaseLinkUrl (), $ responseConfig ['base_link_url ' ]);
207+ $ this ->assertEquals ($ storeConfig ->getBaseUrl (), $ responseConfig ['base_url ' ], 'base_url ' );
208+ $ this ->assertEquals (
209+ $ scopeConfig ->getValue (
210+ 'web/unsecure/base_link_url ' ,
211+ ScopeInterface::SCOPE_STORE ,
212+ $ storeConfig ->getId ()
213+ ),
214+ $ responseConfig ['base_link_url ' ],
215+ 'base_link_url '
216+ );
205217 $ this ->assertEquals ($ storeConfig ->getBaseStaticUrl (), $ responseConfig ['base_static_url ' ]);
206218 $ this ->assertEquals ($ storeConfig ->getBaseMediaUrl (), $ responseConfig ['base_media_url ' ]);
207- $ this ->assertEquals ($ storeConfig ->getSecureBaseUrl (), $ responseConfig ['secure_base_url ' ]);
208- $ this ->assertEquals ($ storeConfig ->getSecureBaseLinkUrl (), $ responseConfig ['secure_base_link_url ' ]);
219+ $ this ->assertEquals ($ storeConfig ->getSecureBaseUrl (), $ responseConfig ['secure_base_url ' ], 'secure_base_url ' );
220+ $ this ->assertEquals (
221+ $ scopeConfig ->getValue (
222+ 'web/secure/base_link_url ' ,
223+ ScopeInterface::SCOPE_STORE ,
224+ $ storeConfig ->getId ()
225+ ),
226+ $ responseConfig ['secure_base_link_url ' ],
227+ 'secure_base_link_url '
228+ );
209229 $ this ->assertEquals ($ storeConfig ->getSecureBaseStaticUrl (), $ responseConfig ['secure_base_static_url ' ]);
210230 $ this ->assertEquals ($ storeConfig ->getSecureBaseMediaUrl (), $ responseConfig ['secure_base_media_url ' ]);
211231 $ this ->assertEquals ($ store ->isUseStoreInUrl (), $ responseConfig ['use_store_in_url ' ]);
0 commit comments