Example #1
0
 /**
  * @expectedException \Magento\Framework\Exception\InputException
  * @expectedExceptionMessage Invalid link type.
  */
 public function testUpdateThrowsExceptionIfLinkTypeIsEmpty()
 {
     $linkId = 1;
     $productSku = 'simple';
     $productId = 1;
     $linkData = ['id' => $linkId, 'title' => 'Title', 'link_type' => '', 'sort_order' => 1, 'price' => 10.1, 'number_of_downloads' => 100, 'is_shareable' => true];
     $this->repositoryMock->expects($this->any())->method('get')->with($productSku, true)->willReturn($this->productMock);
     $this->productMock->expects($this->any())->method('getData')->with('id')->willReturn($productId);
     $linkContentMock = $this->getLinkMock($linkData);
     $this->contentValidatorMock->expects($this->any())->method('isValid')->with($linkContentMock)->willReturn(true);
     $this->service->save($productSku, $linkContentMock, true);
 }