public function testAroundDeleteProductLink() { $subject = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Link::class)->disableOriginalConstructor()->getMock(); $subject->expects($this->any())->method('getIdFieldName')->willReturn('id'); $subject->expects($this->once())->method('load')->with($this->link, 155, 'id'); $this->link->expects($this->any())->method('getLinkTypeId')->willReturn(\Magento\GroupedProduct\Model\ResourceModel\Product\Link::LINK_TYPE_GROUPED); $this->link->expects($this->any())->method('getProductId')->willReturn(12); $this->link->expects($this->any())->method('getLinkedProductId')->willReturn(13); $this->relationProcessor->expects($this->once())->method('removeRelations')->with(12, 13); $this->assertEquals($subject, $this->object->aroundDeleteProductLink($subject, function () use($subject) { return $subject; }, 155)); }