/** * @param bool $isDevAllowed * @param bool $showTemplateHints * @dataProvider afterCreateInactiveDataProvider */ public function testAfterCreateInactive($isDevAllowed, $showTemplateHints) { $this->_coreData->expects($this->any())->method('isDevAllowed')->will($this->returnValue($isDevAllowed)); $this->_setupConfigFixture($showTemplateHints, true); $this->_objectManager->expects($this->never())->method('create'); $engine = $this->getMock('Magento\\Framework\\View\\TemplateEngineInterface', [], [], '', false); $this->assertSame($engine, $this->_model->afterCreate($this->subjectMock, $engine)); }
/** * @param bool $showBlockHints * @dataProvider renderDataProvider */ public function testRender($showBlockHints) { $subject = $this->getMock('Magento\\Framework\\View\\TemplateEngineInterface'); $block = $this->getMock('Magento\\Framework\\View\\Element\\BlockInterface', [], [], 'TestBlock', false); $subject->expects($this->once())->method('render')->with($this->identicalTo($block), 'template.phtml', ['var' => 'val'])->will($this->returnValue('<div id="fixture"/>')); $model = new DebugHints($subject, $showBlockHints); $actualResult = $model->render($block, 'template.phtml', ['var' => 'val']); $this->assertSelectEquals('div > div[title="template.phtml"]', 'template.phtml', 1, $actualResult); $this->assertSelectCount('div > div#fixture', 1, $actualResult); $this->assertSelectEquals('div > div[title="TestBlock"]', 'TestBlock', (int) $showBlockHints, $actualResult); }