示例#1
0
 public function testGetLinkAmount()
 {
     $amount = 100;
     $this->linkMock->expects($this->once())->method('getPrice')->will($this->returnValue($amount));
     $this->linkMock->expects($this->once())->method('getProduct')->will($this->returnValue($this->saleableItemMock));
     $this->calculatorMock->expects($this->once())->method('getAmount')->with($amount, $this->equalTo($this->saleableItemMock))->will($this->returnValue($amount));
     $result = $this->linkPrice->getLinkAmount($this->linkMock);
     $this->assertEquals($amount, $result);
 }
示例#2
0
 /**
  * @param \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject $product
  * @param array $data
  * @param array $expectedItems
  * @dataProvider deleteDataProvider
  */
 public function testDelete($product, array $data, array $expectedItems)
 {
     $this->linkResource->expects($this->once())->method('deleteItems')->with($this->equalTo($expectedItems));
     $this->target->save($product, $data);
 }