@@ -48,24 +48,13 @@ protected function setUp(): void
4848
4949 /**
5050 * @magentoConfigFixture default_store web/seo/use_rewrites 1
51- * @magentoApiDataFixture Magento/Store/_files/store.php
52- * @magentoApiDataFixture Magento/Store/_files/inactive_store.php
51+ * @magentoConfigFixture default_store web/unsecure/base_url http://example.com/
52+ * @magentoConfigFixture default_store web/unsecure/base_link_url http://example.com/
53+ * @magentoApiDataFixture Magento/Store/_files/second_website_with_two_stores.php
5354 */
54- public function testDefaultWebsiteAvailableStoreConfigs (): void
55+ public function testNonDefaultWebsiteAvailableStoreConfigs (): void
5556 {
56- $ storeConfigs = $ this ->storeConfigManager ->getStoreConfigs ();
57-
58- $ expectedAvailableStores = [];
59- $ expectedAvailableStoreCodes = [
60- 'default ' ,
61- 'test '
62- ];
63-
64- foreach ($ storeConfigs as $ storeConfig ) {
65- if (in_array ($ storeConfig ->getCode (), $ expectedAvailableStoreCodes )) {
66- $ expectedAvailableStores [] = $ storeConfig ;
67- }
68- }
57+ $ storeConfigs = $ this ->storeConfigManager ->getStoreConfigs (['fixture_second_store ' , 'fixture_third_store ' ]);
6958
7059 $ query
7160 = <<<QUERY
@@ -101,21 +90,37 @@ public function testDefaultWebsiteAvailableStoreConfigs(): void
10190 }
10291}
10392QUERY ;
104- $ response = $ this ->graphQlQuery ($ query );
93+ $ headerMap = ['Store ' => 'fixture_second_store ' ];
94+ $ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
10595
10696 $ this ->assertArrayHasKey ('availableStores ' , $ response );
107- foreach ($ expectedAvailableStores as $ key => $ storeConfig ) {
97+ foreach ($ storeConfigs as $ key => $ storeConfig ) {
10898 $ this ->validateStoreConfig ($ storeConfig , $ response ['availableStores ' ][$ key ]);
10999 }
110100 }
111101
112102 /**
113103 * @magentoConfigFixture default_store web/seo/use_rewrites 1
114- * @magentoApiDataFixture Magento/Store/_files/second_website_with_two_stores.php
104+ * @magentoConfigFixture default_store web/unsecure/base_url http://example.com/
105+ * @magentoConfigFixture default_store web/unsecure/base_link_url http://example.com/
106+ * @magentoApiDataFixture Magento/Store/_files/store.php
107+ * @magentoApiDataFixture Magento/Store/_files/inactive_store.php
115108 */
116- public function testNonDefaultWebsiteAvailableStoreConfigs (): void
109+ public function testDefaultWebsiteAvailableStoreConfigs (): void
117110 {
118- $ storeConfigs = $ this ->storeConfigManager ->getStoreConfigs (['fixture_second_store ' , 'fixture_third_store ' ]);
111+ $ storeConfigs = $ this ->storeConfigManager ->getStoreConfigs ();
112+
113+ $ expectedAvailableStores = [];
114+ $ expectedAvailableStoreCodes = [
115+ 'default ' ,
116+ 'test '
117+ ];
118+
119+ foreach ($ storeConfigs as $ storeConfig ) {
120+ if (in_array ($ storeConfig ->getCode (), $ expectedAvailableStoreCodes )) {
121+ $ expectedAvailableStores [] = $ storeConfig ;
122+ }
123+ }
119124
120125 $ query
121126 = <<<QUERY
@@ -151,11 +156,10 @@ public function testNonDefaultWebsiteAvailableStoreConfigs(): void
151156 }
152157}
153158QUERY ;
154- $ headerMap = ['Store ' => 'fixture_second_store ' ];
155- $ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
159+ $ response = $ this ->graphQlQuery ($ query );
156160
157161 $ this ->assertArrayHasKey ('availableStores ' , $ response );
158- foreach ($ storeConfigs as $ key => $ storeConfig ) {
162+ foreach ($ expectedAvailableStores as $ key => $ storeConfig ) {
159163 $ this ->validateStoreConfig ($ storeConfig , $ response ['availableStores ' ][$ key ]);
160164 }
161165 }
@@ -209,6 +213,8 @@ private function validateStoreConfig(StoreConfigInterface $storeConfig, array $r
209213
210214 /**
211215 * @magentoConfigFixture default_store web/seo/use_rewrites 1
216+ * @magentoConfigFixture default_store web/unsecure/base_url http://example.com/
217+ * @magentoConfigFixture default_store web/unsecure/base_link_url http://example.com/
212218 * @magentoApiDataFixture Magento/Store/_files/second_website_with_four_stores_divided_in_groups.php
213219 * @magentoConfigFixture web/url/use_store 1
214220 */
@@ -270,6 +276,8 @@ public function testAllStoreConfigsWithCodeInUrlEnabled(): void
270276
271277 /**
272278 * @magentoConfigFixture default_store web/seo/use_rewrites 1
279+ * @magentoConfigFixture default_store web/unsecure/base_url http://example.com/
280+ * @magentoConfigFixture default_store web/unsecure/base_link_url http://example.com/
273281 * @magentoApiDataFixture Magento/Store/_files/second_website_with_four_stores_divided_in_groups.php
274282 */
275283 public function testCurrentGroupStoreConfigs (): void
0 commit comments