32 $this->connection = $this->getMockForAbstractClass(
33 \
Magento\Framework\DB\Adapter\AdapterInterface::class,
42 $metadata = $this->createMock(\
Magento\Framework\EntityManager\EntityMetadata::class);
44 $metadata->expects($this->any())
45 ->method(
'getLinkField')
46 ->willReturn(
'entity_id');
48 $metadata->expects($this->any())
49 ->method(
'getEntityTable')
50 ->willReturn(
'entity_table');
52 $metadata->expects($this->any())
53 ->method(
'getEntityConnection')
54 ->willReturn($this->connection);
56 $this->metadataPool = $this->createMock(\
Magento\Framework\EntityManager\MetadataPool::class);
58 $this->metadataPool->expects($this->any())
59 ->method(
'getMetadata')
60 ->with(
'Test\Entity\Type')
61 ->willReturn($metadata);
63 $this->subject = new \Magento\Framework\Model\ResourceModel\Db\DeleteEntityRow(
74 $this->connection->expects($this->once())
76 ->with(
'entity_table', [
'entity_id = ?' => 1]);
78 $this->subject->execute(
'Test\Entity\Type',
$data);