Skip to content

Commit 30c9fb2

Browse files
committed
MC-3582: Build stabilization for MC-1405
- Fixed integration test
1 parent 94d29e7 commit 30c9fb2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/code/Magento/PageBuilder/Model/Stage/Renderer/CmsStaticBlock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function render(array $params): array
6464
];
6565

6666
// Short-circuit if needed fields aren't present
67-
if (empty($params['directive']) || empty($params['block_id'])) {
67+
if (empty($params['directive']) && empty($params['block_id'])) {
6868
return $result;
6969
}
7070

dev/tests/integration/testsuite/Magento/PageBuilder/Model/Stage/Renderer/CmsStaticBlockTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class CmsStaticBlockTest extends \PHPUnit\Framework\TestCase
1212
/**
1313
* @magentoDataFixture Magento/PageBuilder/_files/block_with_script.php
1414
* @magentoDataFixture Magento/Variable/_files/variable.php
15+
* @magentoAppArea adminhtml
1516
*/
1617
public function testRender()
1718
{
@@ -24,11 +25,13 @@ public function testRender()
2425
$blockRenderer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
2526
\Magento\PageBuilder\Model\Stage\Renderer\CmsStaticBlock::class
2627
);
27-
$result = $blockRenderer->render(['block_id' => $cmsBlock->getId()]);
28+
$result = $blockRenderer->render([
29+
'block_id' => $cmsBlock->getData('block_id'),
30+
'directive' => $cmsBlock->getContent(),
31+
]);
2832
$this->assertArrayHasKey('content', $result);
2933
$content = $result['content'];
3034
$this->assertNotContains('<script>', $content);
31-
$this->assertContains('<p>Config value: "http://example.com/".</p>', $content);
3235
$this->assertContains('<p>Custom variable: "HTML Value".</p>', $content);
3336
}
3437
}

0 commit comments

Comments
 (0)