9 use \Magento\Setup\Fixtures\TaxRatesFixture;
17 private $fixtureModelMock;
26 $this->fixtureModelMock = $this->createMock(\
Magento\Setup\Fixtures\FixtureModel::class);
33 $rateMock = $this->createPartialMock(\
Magento\
Tax\Model\Calculation\Rate::class, [
'setId',
'delete']);
37 $collectionMock->expects($this->once())
41 $csvImportHandlerMock = $this->createMock(\
Magento\TaxImportExport\Model\Rate\CsvImportHandler::class);
44 [\Magento\Tax\Model\Calculation\Rate::class, $rateMock],
45 [\Magento\Tax\Model\ResourceModel\Calculation\Rate\Collection::class, $collectionMock]
49 $objectManagerMock->expects($this->exactly(2))
51 ->will($this->returnValueMap($valueMap));
52 $objectManagerMock->expects($this->once())
54 ->willReturn($csvImportHandlerMock);
56 $this->fixtureModelMock
57 ->expects($this->once())
59 ->willReturn(
'taxRates.file');
60 $this->fixtureModelMock
61 ->expects($this->exactly(3))
62 ->method(
'getObjectManager')
63 ->willReturn($objectManagerMock);
65 $this->model->execute();
70 $csvImportHandlerMock = $this->createMock(\
Magento\TaxImportExport\Model\Rate\CsvImportHandler::class);
71 $csvImportHandlerMock->expects($this->never())->method(
'importFromCsvFile');
74 $objectManagerMock->expects($this->never())
76 ->willReturn($csvImportHandlerMock);
78 $this->fixtureModelMock
79 ->expects($this->never())
80 ->method(
'getObjectManager')
81 ->willReturn($objectManagerMock);
82 $this->fixtureModelMock
83 ->expects($this->once())
87 $this->model->execute();
92 $this->assertSame(
'Generating tax rates', $this->model->getActionTitle());
97 $this->assertSame([], $this->model->introduceParamLabels());
testNoFixtureConfigValue()
testIntroduceParamLabels()