/** * Retrieve a template engine instance by its unique name * * @param string $name * @return \Magento\Framework\View\TemplateEngineInterface */ public function get($name) { if (!isset($this->engines[$name])) { $this->engines[$name] = $this->factory->create($name); } return $this->engines[$name]; }
/** * {@inheritdoc} */ public function create($name) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'create'); if (!$pluginInfo) { return parent::create($name); } else { return $this->___callPlugins('create', func_get_args(), $pluginInfo); } }
/** * @expectedException \UnexpectedValueException * @expectedExceptionMessage Fixture\Module\Model\TemplateEngine has to implement the template engine interface */ public function testCreateInvalidEngine() { $this->_objectManagerMock->expects($this->once())->method('create')->with('Fixture\\Module\\Model\\TemplateEngine')->will($this->returnValue(new \stdClass())); $this->_factory->create('test'); }