@@ -48,24 +48,13 @@ protected function setUp(): void
48
48
49
49
/**
50
50
* @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
53
54
*/
54
- public function testDefaultWebsiteAvailableStoreConfigs (): void
55
+ public function testNonDefaultWebsiteAvailableStoreConfigs (): void
55
56
{
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 ' ]);
69
58
70
59
$ query
71
60
= <<<QUERY
@@ -101,21 +90,37 @@ public function testDefaultWebsiteAvailableStoreConfigs(): void
101
90
}
102
91
}
103
92
QUERY ;
104
- $ response = $ this ->graphQlQuery ($ query );
93
+ $ headerMap = ['Store ' => 'fixture_second_store ' ];
94
+ $ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
105
95
106
96
$ this ->assertArrayHasKey ('availableStores ' , $ response );
107
- foreach ($ expectedAvailableStores as $ key => $ storeConfig ) {
97
+ foreach ($ storeConfigs as $ key => $ storeConfig ) {
108
98
$ this ->validateStoreConfig ($ storeConfig , $ response ['availableStores ' ][$ key ]);
109
99
}
110
100
}
111
101
112
102
/**
113
103
* @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
115
108
*/
116
- public function testNonDefaultWebsiteAvailableStoreConfigs (): void
109
+ public function testDefaultWebsiteAvailableStoreConfigs (): void
117
110
{
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
+ }
119
124
120
125
$ query
121
126
= <<<QUERY
@@ -151,11 +156,10 @@ public function testNonDefaultWebsiteAvailableStoreConfigs(): void
151
156
}
152
157
}
153
158
QUERY ;
154
- $ headerMap = ['Store ' => 'fixture_second_store ' ];
155
- $ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
159
+ $ response = $ this ->graphQlQuery ($ query );
156
160
157
161
$ this ->assertArrayHasKey ('availableStores ' , $ response );
158
- foreach ($ storeConfigs as $ key => $ storeConfig ) {
162
+ foreach ($ expectedAvailableStores as $ key => $ storeConfig ) {
159
163
$ this ->validateStoreConfig ($ storeConfig , $ response ['availableStores ' ][$ key ]);
160
164
}
161
165
}
@@ -209,6 +213,8 @@ private function validateStoreConfig(StoreConfigInterface $storeConfig, array $r
209
213
210
214
/**
211
215
* @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/
212
218
* @magentoApiDataFixture Magento/Store/_files/second_website_with_four_stores_divided_in_groups.php
213
219
* @magentoConfigFixture web/url/use_store 1
214
220
*/
@@ -270,6 +276,8 @@ public function testAllStoreConfigsWithCodeInUrlEnabled(): void
270
276
271
277
/**
272
278
* @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/
273
281
* @magentoApiDataFixture Magento/Store/_files/second_website_with_four_stores_divided_in_groups.php
274
282
*/
275
283
public function testCurrentGroupStoreConfigs (): void
0 commit comments