Пример #1
0
 /**
  * Test for aroundFormat to others
  *
  * @return void
  */
 public function testNonJpyAroundFormat()
 {
     $currency = $this->getMockBuilder('Magento\\Directory\\Model\\Currency')->disableOriginalConstructor()->getMock();
     $currency->expects($this->atLeastOnce())->method('getCode')->willReturn('USD');
     $this->priceCurrency->expects($this->atLeastOnce())->method('getCurrency')->willReturn($currency);
     $this->assertNotEquals('<span class="price">¥100</span>', $this->formatPlugin->aroundFormat($this->priceCurrency, $this->closure, 100.49, 2, null, null));
 }
 /**
  * Test for aroundConverterRound (ceil)
  *
  * @return void
  */
 public function testAroundConvertRoundCeil()
 {
     $this->helper->expects($this->atLeastOnce())->method('getRoundMethod')->willReturn('ceil');
     $currency = $this->getMockBuilder('Magento\\Directory\\Model\\Currency')->disableOriginalConstructor()->getMock();
     $currency->expects($this->atLeastOnce())->method('getCode')->willReturn('JPY');
     $this->priceCurrency->expects($this->atLeastOnce())->method('getCurrency')->willReturn($currency);
     $this->assertEquals(101, $this->priceRoundPlugin->aroundConvertAndRound($this->priceCurrency, $this->closure, 100.49, [], null, 'JPY', 2));
 }
 /**
  * Test for method renderWeeeTaxAttributeWithTax
  *
  * @param \Magento\Framework\DataObject $attribute
  * @param string $expectedResult
  * @dataProvider renderWeeeTaxAttributeAmountWithTaxDataProvider
  */
 public function testRenderWeeeTaxAttributeWithTax($attribute, $expectedResult)
 {
     $this->priceCurrencyMock->expects($this->any())->method('convertAndFormat')->will($this->returnArgument(0));
     $result = $this->model->renderWeeeTaxAttributeWithTax($attribute);
     $this->assertEquals($expectedResult, $result);
 }