public function testGetCommentRetrievesCommentFromCommentModelIfItsProvided() { $config = array('comment' => array('model' => 'Model_Name')); $this->_model->setData($config, 'scope'); $commentModelMock = $this->getMock('Magento\\Backend\\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')); }