|
27 | 27 | use Magento\ImportExport\Model\Import; |
28 | 28 | use Magento\ImportExport\Model\Import\AbstractSource; |
29 | 29 | use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; |
| 30 | +use Magento\Framework\Event\ManagerInterface as EventManagerInterface; |
30 | 31 |
|
31 | 32 | /** |
32 | 33 | * @SuppressWarnings(PHPMD.CouplingBetweenObjects) |
@@ -83,6 +84,11 @@ class ValidateTest extends TestCase |
83 | 84 | */ |
84 | 85 | private $abstractSourceMock; |
85 | 86 |
|
| 87 | + /** |
| 88 | + * @var EventManagerInterface|MockObject |
| 89 | + */ |
| 90 | + private $eventManagerMock; |
| 91 | + |
86 | 92 | protected function setUp(): void |
87 | 93 | { |
88 | 94 | $objectManagerHelper = new ObjectManagerHelper($this); |
@@ -147,6 +153,13 @@ protected function setUp(): void |
147 | 153 | ->disableOriginalConstructor() |
148 | 154 | ->getMockForAbstractClass(); |
149 | 155 |
|
| 156 | + $this->eventManagerMock = $this->getMockBuilder(EventManagerInterface::class) |
| 157 | + ->getMockForAbstractClass(); |
| 158 | + |
| 159 | + $this->contextMock->expects($this->any()) |
| 160 | + ->method('getEventManager') |
| 161 | + ->willReturn($this->eventManagerMock); |
| 162 | + |
150 | 163 | $this->validate = new Validate( |
151 | 164 | $this->contextMock, |
152 | 165 | $this->reportProcessorMock, |
@@ -337,6 +350,10 @@ public function testFileVerifiedWithImport() |
337 | 350 | ->method('getAllErrors') |
338 | 351 | ->willReturn($errorAggregatorMock); |
339 | 352 |
|
| 353 | + $this->eventManagerMock->expects($this->once()) |
| 354 | + ->method('dispatch') |
| 355 | + ->with('log_admin_import'); |
| 356 | + |
340 | 357 | $this->resultFactoryMock->expects($this->any()) |
341 | 358 | ->method('create') |
342 | 359 | ->with(ResultFactory::TYPE_LAYOUT) |
|
0 commit comments