Example #1
0
 /**
  * @covers Mage_Core_Model_Layout_Translator::translateArgument
  */
 public function testTranslateArgumentViaParentWithNodeThatIsNotInTranslateList()
 {
     $this->_helperFactoryMock->expects($this->never())->method('get');
     $actual = $this->_object->translateArgument($this->_xmlDocument->arguments_parent->node_no_translated);
     $this->assertEquals('no translated', $actual);
 }
Example #2
0
 /**
  * Run action defined in layout update
  *
  * @param Mage_Core_Model_Layout_Element $node
  * @param Mage_Core_Model_Layout_Element $parent
  */
 protected function _generateAction($node, $parent)
 {
     $configPath = $node->getAttribute('ifconfig');
     if ($configPath && !Mage::getStoreConfigFlag($configPath)) {
         return;
     }
     $method = $node->getAttribute('method');
     $parentName = $node->getAttribute('block');
     if (empty($parentName)) {
         $parentName = $parent->getElementName();
     }
     $profilerKey = 'BLOCK_ACTION:' . $parentName . '>' . $method;
     Magento_Profiler::start($profilerKey);
     $block = $this->getBlock($parentName);
     if (!empty($block)) {
         $args = $this->_extractArgs($node);
         $this->_translator->translateActionParameters($node, $args);
         call_user_func_array(array($block, $method), $args);
     }
     Magento_Profiler::stop($profilerKey);
 }