public function testGetCommentTranslatesComment() { $helperMock = $this->getMock('Mage_Backend_Helper_Data', array(), array(), '', false); $helperMock->expects($this->once())->method('__')->with('some_comment')->will($this->returnValue('translatedComment')); $this->_factoryHelperMock->expects($this->once())->method('get')->with('Mage_Module_Helper_Data')->will($this->returnValue($helperMock)); $this->assertEquals('', $this->_model->getLabel()); $this->_model->setData(array('label' => 'some_comment', 'module' => 'Mage_Module'), 'someScope'); $this->assertEquals('translatedComment', $this->_model->getLabel()); }
/** * Retrieve field label * * @param string $labelPrefix * @return string */ public function getLabel($labelPrefix = '') { $label = ''; if ($labelPrefix) { $label .= $this->_helperFactory->get($this->_getTranslationModule())->__($labelPrefix) . ' '; } $label .= parent::getLabel(); return $label; }