11 use Magento\Tax\Api\Data\TaxRateInterfaceFactory;
12 use Magento\Tax\Api\Data\TaxRuleInterfaceFactory;
15 use Magento\Tax\Model\ResourceModel\Calculation\Rate\CollectionFactory;
26 private $fixtureModelMock;
36 private $configWriterMock;
41 private $taxRateRepositoryMock;
46 private $taxRateFactoryMock;
51 private $taxRateCollectionFactoryMock;
56 private $taxRuleFactoryMock;
61 private $taxRuleRepositoryMock;
65 $this->fixtureModelMock = $this->getMockBuilder(\
Magento\Setup\Fixtures\FixtureModel::class)
66 ->disableOriginalConstructor()
69 $this->taxRateFactoryMock = $this->getMockBuilder(TaxRateInterfaceFactory::class)
70 ->disableOriginalConstructor()
73 $this->taxRateRepositoryMock = $this->getMockBuilder(TaxRateRepositoryInterface::class)
74 ->disableOriginalConstructor()
77 $this->configWriterMock = $this->getMockBuilder(ConfigWriter::class)
78 ->disableOriginalConstructor()
81 $this->taxRuleFactoryMock = $this->getMockBuilder(TaxRuleInterfaceFactory::class)
82 ->disableOriginalConstructor()
85 $this->taxRuleRepositoryMock = $this->getMockBuilder(TaxRuleRepositoryInterface::class)
86 ->disableOriginalConstructor()
87 ->setMethods([
'save',
'get',
'delete',
'deleteById',
'getList'])
90 $this->fixtureModelMock
91 ->expects($this->exactly(2))
93 ->will($this->returnValueMap(
100 $this->taxRateCollectionFactoryMock = $this->getMockBuilder(CollectionFactory::class)
101 ->disableOriginalConstructor()
102 ->setMethods([
'create'])
105 $taxRateCollectionMock = $this->getMockBuilder(Collection::class)
106 ->disableOriginalConstructor()
107 ->setMethods([
'getAllIds'])
110 $this->taxRateCollectionFactoryMock->expects($this->once())
112 ->willReturn($taxRateCollectionMock);
114 $taxRateCollectionMock->expects($this->once())
115 ->method(
'getAllIds')
119 $this->fixtureModelMock,
120 $this->taxRuleRepositoryMock,
121 $this->taxRuleFactoryMock,
122 $this->taxRateCollectionFactoryMock,
123 $this->taxRateFactoryMock,
124 $this->taxRateRepositoryMock,
125 $this->configWriterMock
128 $this->model->execute();