示例#1
0
 /**
  * @param string $expected
  * @param bool $dataObjectIsOrder
  * @param bool $isCurrencyDifferent
  * @param bool $magentoDataObjectHasOrder
  * @param bool $strong
  * @param string $separator
  * @dataProvider displayPricesDataProvider
  */
 public function testDisplayPriceAttribute($expected, $dataObjectIsOrder, $isCurrencyDifferent = true, $magentoDataObjectHasOrder = true, $strong = false, $separator = '<br/>')
 {
     $this->orderMock->expects($this->any())->method('isCurrencyDifferent')->will($this->returnValue($isCurrencyDifferent));
     $storeMock = $this->getMockBuilder('Magento\\Store\\Model\\Store')->disableOriginalConstructor()->getMock();
     $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($storeMock));
     $this->priceCurrency->expects($this->any())->method('format')->will($this->returnValue('storeFormattedPrice'));
     $dataObject = $this->orderMock;
     if (!$dataObjectIsOrder) {
         $returnRes = false;
         if ($magentoDataObjectHasOrder) {
             $returnRes = $this->orderMock;
         }
         $this->magentoObjectMock->expects($this->once())->method('getOrder')->will($this->returnValue($returnRes));
         $this->magentoObjectMock->expects($this->any())->method('getData')->will($this->returnValue('data'));
         $dataObject = $this->magentoObjectMock;
     }
     $this->assertEquals($expected, $this->adminHelper->displayPriceAttribute($dataObject, 'code', $strong, $separator));
 }
示例#2
0
 /**
  * Display price attribute
  *
  * @param string $code
  * @param bool $strong
  * @param string $separator
  * @return string
  */
 public function displayPriceAttribute($code, $strong = false, $separator = '<br/>')
 {
     return $this->_adminHelper->displayPriceAttribute($this->getPriceDataObject(), $code, $strong, $separator);
 }