Skip to content

Commit b05bf27

Browse files
committed
AC-14266: Import/Export action logs are not created in System
1 parent 0bc2cc1 commit b05bf27

File tree

1 file changed

+17
-0
lines changed
  • app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Import

1 file changed

+17
-0
lines changed

app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Import/ValidateTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use Magento\ImportExport\Model\Import;
2828
use Magento\ImportExport\Model\Import\AbstractSource;
2929
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
30+
use Magento\Framework\Event\ManagerInterface as EventManagerInterface;
3031

3132
/**
3233
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -83,6 +84,11 @@ class ValidateTest extends TestCase
8384
*/
8485
private $abstractSourceMock;
8586

87+
/**
88+
* @var EventManagerInterface|MockObject
89+
*/
90+
private $eventManagerMock;
91+
8692
protected function setUp(): void
8793
{
8894
$objectManagerHelper = new ObjectManagerHelper($this);
@@ -147,6 +153,13 @@ protected function setUp(): void
147153
->disableOriginalConstructor()
148154
->getMockForAbstractClass();
149155

156+
$this->eventManagerMock = $this->getMockBuilder(EventManagerInterface::class)
157+
->getMockForAbstractClass();
158+
159+
$this->contextMock->expects($this->any())
160+
->method('getEventManager')
161+
->willReturn($this->eventManagerMock);
162+
150163
$this->validate = new Validate(
151164
$this->contextMock,
152165
$this->reportProcessorMock,
@@ -337,6 +350,10 @@ public function testFileVerifiedWithImport()
337350
->method('getAllErrors')
338351
->willReturn($errorAggregatorMock);
339352

353+
$this->eventManagerMock->expects($this->once())
354+
->method('dispatch')
355+
->with('log_admin_import');
356+
340357
$this->resultFactoryMock->expects($this->any())
341358
->method('create')
342359
->with(ResultFactory::TYPE_LAYOUT)

0 commit comments

Comments
 (0)