/** * @covers Mage_Core_Model_Layout_Translator::translateActionParameters */ public function testTranslateActionParametersWithoutModule() { $args = array('two' => 'test', 'three' => 'test'); $expected = array('two' => 'translated', 'three' => 'test'); $this->_helperFactoryMock->expects($this->once())->method('get')->with('Mage_Core')->will($this->returnValue($this->_helperMock)); $this->_object->translateActionParameters($this->_xmlDocument->action_four, $args); $this->assertEquals($expected, $args); }
/** * 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); }