Skip to content

Commit 1e5a9db

Browse files
committed
Updated unit test with JsonHexTag
1 parent d67374f commit 1e5a9db

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ protected function setUp() : void
5454
->getMockForAbstractClass();
5555

5656
$escaper = $this->getObjectManager()->getObject(\Magento\Framework\Escaper::class);
57+
$this->serializer = $this->createMock(\Magento\Framework\Serialize\Serializer\JsonHexTag::class);
5758

5859
$this->viewModel = $this->getObjectManager()->getObject(
5960
Breadcrumbs::class,
6061
[
6162
'catalogData' => $this->catalogHelper,
6263
'scopeConfig' => $this->scopeConfig,
64+
'jsonSerializer' => $this->serializer,
6365
'escaper' => $escaper
6466
]
6567
);
@@ -141,6 +143,8 @@ public function testGetJsonConfiguration($product, string $expectedJson) : void
141143
->with('catalog/seo/category_url_suffix', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)
142144
->willReturn('."html');
143145

146+
$this->serializer->expects($this->once())->method('serialize')->willReturn($expectedJson);
147+
144148
$this->assertEquals($expectedJson, $this->viewModel->getJsonConfiguration());
145149
}
146150

0 commit comments

Comments
 (0)