コード例 #1
0
ファイル: ItemTest.php プロジェクト: Doability/magento2dev
 public function testGetProductId()
 {
     $productId = 1;
     $this->orderItemMock->expects($this->once())->method('getProductId')->willReturn($productId);
     $result = $this->item->getProductId($this->orderItemMock);
     $this->assertEquals($productId, $result);
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function getProductId(\Magento\Sales\Model\Order\Item $item)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getProductId');
     if (!$pluginInfo) {
         return parent::getProductId($item);
     } else {
         return $this->___callPlugins('getProductId', func_get_args(), $pluginInfo);
     }
 }