8 use Magento\Developer\Model\TemplateEngine\Decorator\DebugHintsFactory;
39 $this->scopeConfigMock = $this->getMockBuilder(\
Magento\Framework\
App\Config\ScopeConfigInterface::class)
40 ->getMockForAbstractClass();
42 $this->storeManager = $this->getMockBuilder(\
Magento\Store\Model\StoreManagerInterface::class)
43 ->getMockForAbstractClass();
45 $this->devHelperMock = $this->getMockBuilder(\
Magento\Developer\Helper\Data::class)
46 ->disableOriginalConstructor()
49 $this->debugHintsFactory = $this->getMockBuilder(
50 \
Magento\Developer\Model\TemplateEngine\Decorator\DebugHintsFactory::class
52 ->setMethods([
'create'])
53 ->disableOriginalConstructor()
69 $this->devHelperMock->expects($this->once())
70 ->method(
'isDevAllowed')
75 $engine = $this->createMock(\
Magento\Framework\View\TemplateEngineInterface::class);
77 $debugHintsDecorator = $this->getMockBuilder(
78 \
Magento\Developer\Model\TemplateEngine\Decorator\DebugHints::class
80 ->disableOriginalConstructor()
83 $this->debugHintsFactory->expects($this->once())
87 'showBlockHints' => $showBlockHints,
89 ->willReturn($debugHintsDecorator);
91 $subjectMock = $this->getMockBuilder(\
Magento\Framework\View\TemplateEngineFactory::class)
92 ->disableOriginalConstructor()
95 $this->httpMock = $this->createMock(\
Magento\Framework\
App\Request\Http::class);
98 $this->scopeConfigMock,
100 $this->devHelperMock,
101 $this->debugHintsFactory,
104 $debugHintsWithParam,
108 $this->assertEquals($debugHintsDecorator, $debugHints->afterCreate($subjectMock, $engine));
117 [
'dev/debug/template_hints_storefront',
false,
false,
null],
118 [
'dev/debug/template_hints_storefront',
true,
false,
null],
119 [
'dev/debug/template_hints_admin',
false,
false,
null],
120 [
'dev/debug/template_hints_admin',
true,
false,
null],
135 $debugHintsWithParam,
138 $this->devHelperMock->expects($this->any())
139 ->method(
'isDevAllowed')
140 ->willReturn($isDevAllowed);
144 $engine = $this->createMock(\
Magento\Framework\View\TemplateEngineInterface::class);
146 $subjectMock = $this->getMockBuilder(\
Magento\Framework\View\TemplateEngineFactory::class)
147 ->disableOriginalConstructor()
150 $this->httpMock = $this->createMock(\
Magento\Framework\
App\Request\Http::class);
153 $this->scopeConfigMock,
155 $this->devHelperMock,
156 $this->debugHintsFactory,
159 $debugHintsWithParam,
163 $this->assertSame($engine, $debugHints->afterCreate($subjectMock, $engine));
172 [
'dev/debug/template_hints_storefront',
false,
false,
false,
null],
173 [
'dev/debug/template_hints_storefront',
false,
true,
false,
null],
174 [
'dev/debug/template_hints_storefront',
true,
false,
false,
null],
175 [
'dev/debug/template_hints_admin',
false,
false,
false,
null],
176 [
'dev/debug/template_hints_admin',
false,
true,
false,
null],
177 [
'dev/debug/template_hints_admin',
true,
false,
false,
null],
192 $storeMock = $this->createMock(\
Magento\Store\Api\Data\StoreInterface::class);
193 $storeMock->expects($this->once())
196 $this->storeManager->expects($this->once())
198 ->willReturn($storeMock);
200 $this->scopeConfigMock->expects($this->atLeastOnce())
afterCreateInactiveDataProvider()
testAfterCreateInactive( $debugHintsPath, $isDevAllowed, $showTemplateHints, $debugHintsWithParam, $debugHintsParameter)
afterCreateActiveDataProvider()
setupConfigFixture($debugHintsPath, $showTemplateHints, $showBlockHints)
const XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS
testAfterCreateActive( $debugHintsPath, $showBlockHints, $debugHintsWithParam, $debugHintsParameter)