Skip to content

Commit 426c596

Browse files
authored
Merge branch 'develop' into PB-170
2 parents a44c8dd + 82a65f4 commit 426c596

File tree

2 files changed

+50
-1
lines changed
  • app/code/Magento/PageBuilder/Model/Stage
  • dev/tests/integration/testsuite/Magento/PageBuilder/Model/Stage

2 files changed

+50
-1
lines changed

app/code/Magento/PageBuilder/Model/Stage/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function getConfig()
152152
'menu_sections' => $this->getMenuSections(),
153153
'content_types' => $this->getContentTypes(),
154154
'stage_config' => $this->data,
155-
'media_url' => $this->urlBuilder->getBaseUrl(['_type' => UrlInterface::URL_TYPE_MEDIA]),
155+
'media_url' => $this->frontendUrlBuilder->getBaseUrl(['_type' => UrlInterface::URL_TYPE_MEDIA]),
156156
'preview_url' => $this->urlBuilder->getUrl('pagebuilder/stage/preview'),
157157
'render_url' => $this->urlBuilder->getUrl('pagebuilder/stage/render'),
158158
'column_grid_default' => $this->scopeConfig->getValue(self::XML_PATH_COLUMN_GRID_DEFAULT),
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
}

0 commit comments

Comments
 (0)