21 $attributeMock = $this->getMockBuilder(\
Magento\Eav\Model\Entity\Attribute::class)
22 ->disableOriginalConstructor()
23 ->setMethods([
'loadByCode',
'getId',
'setData',
'save',
'__wakeup'])
26 ->expects($this->any())
28 ->will($this->returnValue(1));
30 $attributeFactoryMock = $this->getMockBuilder(\
Magento\Eav\Model\Entity\AttributeFactory::class)
31 ->disableOriginalConstructor()
32 ->setMethods([
'create',
'__wakeup'])
35 ->expects($this->any())
37 ->will($this->returnValue($attributeMock));
39 $resourceMock = $this->getMockBuilder(\
Magento\Framework\Model\
ResourceModel\Db\AbstractDb::class)
40 ->disableOriginalConstructor()
41 ->setMethods([
'beginTransaction',
'_construct',
'getIdFieldName',
'addCommitCallback',
'commit',
42 'save',
'__wakeup', ])
45 ->expects($this->any())
46 ->method(
'beginTransaction')
47 ->will($this->returnValue(
null));
49 ->expects($this->any())
50 ->method(
'getIdFieldName')
51 ->will($this->returnValue(
'tax'));
53 ->expects($this->any())
54 ->method(
'addCommitCallback')
55 ->will($this->returnValue($resourceMock));
61 'resource' => $resourceMock,
62 'attributeFactory' => $attributeFactoryMock
66 $taxClass->setDataChanges(
true);