8 use \Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
32 $this->objectManagerHelper =
new ObjectManagerHelper($this);
33 $this->appStateMock = $this->createMock(\
Magento\Framework\
App\State::class);
35 $this->filterEmulate = $this->objectManagerHelper->getObject(
36 \
Magento\Widget\Model\Template\FilterEmulate::class,
37 [
'appState' => $this->appStateMock]
48 '{{widget type="Widget\\Link" anchor_text="Test" template="block.phtml" id_path="p/1"}}',
50 ' type="" anchor_text="Test" template="block.phtml" id_path="p/1"' 53 $this->appStateMock->expects($this->once())
54 ->method(
'emulateAreaCode')
55 ->with(
'frontend', [$this->filterEmulate,
'generateWidget'], [$construction])
57 $this->assertSame(
$result, $this->filterEmulate->widgetDirective($construction));