File tree Expand file tree Collapse file tree 2 files changed +51
-2
lines changed
app/code/Magento/PageBuilder/Model/Stage
dev/tests/integration/testsuite/Magento/PageBuilder/Model/Stage Expand file tree Collapse file tree 2 files changed +51
-2
lines changed Original file line number Diff line number Diff line change 11
11
use Magento \Framework \UrlInterface ;
12
12
13
13
/**
14
- * Class Config
14
+ * Provide config for page builder
15
15
*
16
16
* @api
17
17
*/
@@ -134,7 +134,7 @@ public function getConfig()
134
134
'menu_sections ' => $ this ->getMenuSections (),
135
135
'content_types ' => $ this ->getContentTypes (),
136
136
'stage_config ' => $ this ->data ,
137
- 'media_url ' => $ this ->urlBuilder ->getBaseUrl (['_type ' => UrlInterface::URL_TYPE_MEDIA ]),
137
+ 'media_url ' => $ this ->frontendUrlBuilder ->getBaseUrl (['_type ' => UrlInterface::URL_TYPE_MEDIA ]),
138
138
'preview_url ' => $ this ->urlBuilder ->getUrl ('pagebuilder/stage/preview ' ),
139
139
'render_url ' => $ this ->urlBuilder ->getUrl ('pagebuilder/stage/render ' ),
140
140
'column_grid_default ' => $ this ->scopeConfig ->getValue (self ::XML_PATH_COLUMN_GRID_DEFAULT ),
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ declare (strict_types=1 );
8
+
9
+ namespace Magento \PageBuilder \Model \Stage ;
10
+
11
+ use Magento \TestFramework \Helper \Bootstrap ;
12
+ use PHPUnit \Framework \TestCase ;
13
+
14
+ /**
15
+ * Test config for page builder
16
+ */
17
+ class ConfigTest extends TestCase
18
+ {
19
+ /**
20
+ * @var Config
21
+ */
22
+ private $ model ;
23
+
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ protected function setUp ()
28
+ {
29
+ $ objectManager = Bootstrap::getObjectManager ();
30
+ $ this ->model = $ objectManager ->get (Config::class);
31
+ }
32
+
33
+ /**
34
+ * Test that "media_url" should be the same as storefront media URL
35
+ *
36
+ * @magentoConfigFixture admin/url/use_custom 1
37
+ * @magentoConfigFixture admin/url/custom https://backend.magento.test/
38
+ * @magentoConfigFixture admin_store web/secure/base_url https://backend.magento.test/
39
+ * @magentoConfigFixture admin_store web/unsecure/base_url https://backend.magento.test/
40
+ * @magentoConfigFixture admin/url/use_custom_path 1
41
+ * @magentoConfigFixture admin/url/custom_path secret
42
+ * @magentoAppIsolation enabled
43
+ * @magentoAppArea adminhtml
44
+ */
45
+ public function testMediaUrlShouldBeTheSameAsStorefrontMediaURL ()
46
+ {
47
+ $ this ->assertEquals ('http://localhost/pub/media/ ' , $ this ->model ->getConfig ()['media_url ' ]);
48
+ }
49
+ }
You can’t perform that action at this time.
0 commit comments