예제 #1
0
 public function testGetCommentRetrievesCommentFromCommentModelIfItsProvided()
 {
     $config = ['comment' => ['model' => 'Model_Name']];
     $this->_model->setData($config, 'scope');
     $commentModelMock = $this->getMock('Magento\\Config\\Model\\Config\\CommentInterface');
     $commentModelMock->expects($this->once())->method('getCommentText')->with('currentValue')->will($this->returnValue('translatedValue'));
     $this->_commentFactoryMock->expects($this->once())->method('create')->with('Model_Name')->will($this->returnValue($commentModelMock));
     $this->assertEquals('translatedValue', $this->_model->getComment('currentValue'));
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function getComment($currentValue = '')
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getComment');
     if (!$pluginInfo) {
         return parent::getComment($currentValue);
     } else {
         return $this->___callPlugins('getComment', func_get_args(), $pluginInfo);
     }
 }