Example #1
0
 /**
  * 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];
 }
Example #2
0
 /**
  * {@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);
     }
 }
Example #3
0
 /**
  * @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');
 }