Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DebugHintsTest.php
Go to the documentation of this file.
1 <?php
7 
8 class DebugHintsTest extends \PHPUnit\Framework\TestCase
9 {
14  public function testRender($showBlockHints)
15  {
16  $subject = $this->createMock(\Magento\Framework\View\TemplateEngineInterface::class);
17  $block = $this->getMockBuilder(\Magento\Framework\View\Element\BlockInterface::class)
18  ->setMockClassName('TestBlock')
19  ->getMock();
20  $subject->expects(
21  $this->once()
22  )->method(
23  'render'
24  )->with(
25  $this->identicalTo($block),
26  'template.phtml',
27  ['var' => 'val']
28  )->will(
29  $this->returnValue('<div id="fixture"/>')
30  );
31  $model = new \Magento\Developer\Model\TemplateEngine\Decorator\DebugHints($subject, $showBlockHints);
32  $actualResult = $model->render($block, 'template.phtml', ['var' => 'val']);
33  $this->assertNotNull($actualResult);
34  }
35 
39  public function renderDataProvider()
40  {
41  return ['block hints disabled' => [false], 'block hints enabled' => [true]];
42  }
43 }
$block
Definition: block.php:8