Beispiel #1
0
 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());
 }
Beispiel #2
0
 /**
  * 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;
 }